No video

Working below a DAX formula’s granularity

  Рет қаралды 19,861

SQLBI

SQLBI

Күн бұрын

How to control the result of a DAX measure used in a report with granularity below the granularity supported by the formula. Article and download: sql.bi/661463/...
How to learn DAX: www.sqlbi.com/...
The definitive guide to DAX: www.sqlbi.com/...

Пікірлер: 41
@gulhermepereira249
@gulhermepereira249 3 жыл бұрын
This channel is one of the best DAX reference out there, and it's free! Thank you, Alberto
@juancarlosvillegascuevas2597
@juancarlosvillegascuevas2597 Жыл бұрын
You're such a master with DAX, I watched the video and I realized that I need to understand better the fundamentals in order to understand the code you share with us. Great KZfaq channel!!
@bhaveshpatelaus
@bhaveshpatelaus 3 жыл бұрын
This is the ultimate gold of how DAX really works and enabling data models for large number of users to self serve without explaining each of them how that measure really works and why it is displaying this results. Thank you Alberto and a must watch for all Tabular model designers.
@laviedandre
@laviedandre 3 жыл бұрын
Brilliant! I've usually struggled with controlling the result shown below the intended granularity. This is a great step-by-step tutorial of how to manage the result above and below!
@sue_bayes
@sue_bayes 3 жыл бұрын
Really useful to see the different approaches based on the customer need. The explanation of High Months 3 showing how to return the result of each variable step by step was helpful in understanding how you built the measure and why you had to use remove filters instead of AllExcept. Thank you.
@sbn4862
@sbn4862 2 жыл бұрын
I've seen this video 6 times with today's, evry time it gives me hope to learn DAX. We need a book with different training tasks for evry concept and function FROM ZERO TO MAX. I'll by it imidently. Thank you
@SQLBI
@SQLBI 2 жыл бұрын
You probably want this book :) www.sqlbi.com/books/the-definitive-guide-to-dax-2nd-edition/
@sbn4862
@sbn4862 2 жыл бұрын
@@SQLBI Yes Thank you
@franciscoclaudio4818
@franciscoclaudio4818 3 жыл бұрын
With every video or article I see from SQLBI I feel illiterate on DAX. Excellent class!
@mnowako
@mnowako 3 жыл бұрын
Excellent lesson. Thank you, professor Alberto.
@JonathanCHANAL
@JonathanCHANAL 3 жыл бұрын
This is just perfect, thank you for sharing
@danielsiffredi8403
@danielsiffredi8403 3 жыл бұрын
Alberto, you are a maestro!
@pawewrona9749
@pawewrona9749 3 жыл бұрын
Another amazing DAX video
@javedkhan-tz6fn
@javedkhan-tz6fn 3 жыл бұрын
Superb....this is the root cause
@l3ol3lca
@l3ol3lca 3 жыл бұрын
In third measure instead of using variables, we can use simple condition: if isfiltered( 'Date'[Date]) then blank, else calculate(.....). Thank you!
@ajit555db
@ajit555db 3 жыл бұрын
In the article too, the link to the KZfaq video can be provided so that someone reading the article directly would not miss this video.
@SQLBI
@SQLBI 3 жыл бұрын
Thanks for reporting! We just added the video to the article, it seems we forgot to include that link!
@anshumansingh3106
@anshumansingh3106 3 жыл бұрын
excellent explanation....
@yacobberk3931
@yacobberk3931 3 жыл бұрын
Hi, Based on your lesson , I can propose shorter solution for "the blank option whenever the report goes below the supported granularity" High Months (4) = CALCULATE ( SUMX( VALUES ( 'Date'[Calendar Year Month]) , var daysNo= count('Date'[Calendar Year Month]) Return if([Sales Amount]>30000 && daysNo>1 ,1)), all('Date'[Calendar Year Month]), VALUES ( 'Date'[Calendar Year Month] ) )
@SQLBI
@SQLBI 3 жыл бұрын
It's an option, too - sometimes users are surprised by the UI behavior doing that (it seems something doesn't work).
@yacobberk3931
@yacobberk3931 3 жыл бұрын
​@@SQLBI Hi again, my option High Months (4) is giving the same result as your High Months (3) expression , please have a look drive.google.com/file/d/1QurWVEGUUtujdpdUS0lbuB70OeTksALW/view
@goldwhispers
@goldwhispers 3 жыл бұрын
such an important video! grazie!
@ajit555db
@ajit555db 3 жыл бұрын
To force the measures at correct granularity, I am thinking about the following pattern: 1. Create a set of "Granularity level" measures to identify the granularity e.g. "Calendar Level" which provides if the calculation is happening at Year, Month or Day level. (reference: www.daxpatterns.com/hierarchies/) 2. In the measure development, determine the granularity using above "granularity level" measures and then change the context accordingly and calculate the expression. This might help in standardization of measure development at correct granularity.
@josemadrid4343
@josemadrid4343 3 жыл бұрын
Thank you!
@ranganathkumar9188
@ranganathkumar9188 3 жыл бұрын
very help full video i would like to know can we include Product / Customer slicing along with Calendar
@SQLBI
@SQLBI 3 жыл бұрын
Yes, of course!
@ajit555db
@ajit555db 3 жыл бұрын
I feel in the DAX book, we are providing lots of concepts and details about functions/modeling first and then explain measures. It is really overwhelming for the first time reader. Without understanding measures first in a simple way, it is very difficult to understand how these various concepts (evaluation context, transition, lineage, relationships, iterators, granularity etc) work in sync and we never understand the dynamics of concepts working together. Due to this, when we reach to write advanced measures, we can't since we did not understand the concepts in the first place. I think the book should start upfront with simple measure without any tables and slowly develop measures in increasing complexity using advanced concepts (evaluation context, relationships etc). This would force students to understand the concepts with respect to the measure and they can understand the dynamics of interrelated concepts much better. I am reading the DAX book for the fourth time, and this time, reading each chapter again relating with measure development and slowly the brain has started inter-relating the concepts wrt measures.
@sbn4862
@sbn4862 2 жыл бұрын
super
@hannesw.8297
@hannesw.8297 3 жыл бұрын
Hi Alberto! The last solution seems very complicated to me, I just would to this: High Months (3) = IF(NOT( ISFILTERED('Date'[Date])), [High Months (2)]) Seems to have the same outcome, are there any issues I oversee?
@porraloka31
@porraloka31 2 жыл бұрын
If the user wants to see at the week granularity you'll have problems with your code, as weeks are below the month granularity but above days.
@Darknesslc3
@Darknesslc3 3 жыл бұрын
is it correct to say that context transition is effectively does not happen when we input something in the filter argument of CALCULATE? Or it just replace part of the filter context generated by context transition? Based on my understanding the context transition only happen on the in CALCULATE , but the filter argument will modify the filter context generated by context transition in the end
@SQLBI
@SQLBI 3 жыл бұрын
Yes, context transition only affects the expression. Check out evaluation order here: dax.guide/calculate/
@FitofnietOfficial
@FitofnietOfficial 2 жыл бұрын
Hi Alberto, When I write the "High Months (Wrong)" measure as follows, then I also get the correct values. I'm curious why this formula works when you put the filter arguments in a outer calculate: High Months (Wrong) = CALCULATE ( SUMX ( VALUES ( 'Date'[Calendar Year Month] ), IF ( [Sales Amount] > 30000, 1 ) ), ALL ( 'Date' ), VALUES ( 'Date'[Calendar Year Month] ) ) Thanks,
@supersayan9888
@supersayan9888 Жыл бұрын
That's because there is no context transition thats taken place when you directly write the expression in the row context.
@Bharath_PBI
@Bharath_PBI 3 жыл бұрын
Context transition, learnt from Definitive Guide to DAX first edition. Enjoying DAX with you. 👍 Can we use isinscope() to get the right level in hierarchy to get rid of 1 at day level ?
@SQLBI
@SQLBI 3 жыл бұрын
Outside of the SUMX, yes.
@Bharath_PBI
@Bharath_PBI 3 жыл бұрын
@@SQLBI Yes, thank you 👍
@MedinaZyzz
@MedinaZyzz 3 жыл бұрын
I'm currently reading the Definitive Guide to DAX for the first time, I'm pretty much a newbie in the DAX world so I kind of get the concepts to an extent and understand the formulas but can't think of the formulas by myself... is it normal? What are your suggestions? Thanks in advance Alberto!
@SQLBI
@SQLBI 3 жыл бұрын
Just practice! The evaluation context is a unique concept that does not have similarities with other languages. Start with simple reports and task, it usually takes months before you start "thinking" in DAX... don't give up!
@MedinaZyzz
@MedinaZyzz 3 жыл бұрын
@@SQLBI Thanks fot the advice! it means a lot to me.
Optimizing nested iterators in DAX
17:31
SQLBI
Рет қаралды 21 М.
Kids' Guide to Fire Safety: Essential Lessons #shorts
00:34
Fabiosa Animated
Рет қаралды 11 МЛН
I'm Excited To see If Kelly Can Meet This Challenge!
00:16
Mini Katana
Рет қаралды 33 МЛН
SPILLED CHOCKY MILK PRANK ON BROTHER 😂 #shorts
00:12
Savage Vlogs
Рет қаралды 42 МЛН
🚨 YOU'RE VISUALIZING YOUR DATA WRONG. And Here's Why...
17:11
Adam Finer - Learn BI Online
Рет қаралды 54 М.
Understanding data lineage in DAX
18:14
SQLBI
Рет қаралды 29 М.
When to use KEEPFILTERS over iterators
18:56
SQLBI
Рет қаралды 47 М.
Introducing DEFINE COLUMN in DAX queries
14:32
SQLBI
Рет қаралды 9 М.
Row Context in DAX
20:42
SQLBI
Рет қаралды 96 М.
Exploring the SEMANTIC MODEL in Power BI
27:30
How to Power BI
Рет қаралды 122 М.
Making DAX Easy
20:01
How to Power BI
Рет қаралды 203 М.
Filter context in DAX explained visually
24:40
SQLBI
Рет қаралды 19 М.
Introducing CALCULATE in DAX
13:57
SQLBI
Рет қаралды 77 М.
Kids' Guide to Fire Safety: Essential Lessons #shorts
00:34
Fabiosa Animated
Рет қаралды 11 МЛН