***** Related Links ***** Manage Multiple Date Calculations In Your Fact Table - Advanced Power BI Technique - blog.enterprisedna.co/manage-multiple-date-calculations-in-your-fact-table-advanced-power-bi-technique/ Optimizing Your Power BI Formula Using Advanced DAX Functions - blog.enterprisedna.co/data-segmentation-techniques-based-on-any-measure-advanced-dax/ Data Segmentation Techniques Based On Any Measure - Advanced DAX - blog.enterprisedna.co/data-segmentation-techniques-based-on-any-measure-advanced-dax/ ***** Related Course Modules ***** Ultimate Beginners Guide to DAX - portal.enterprisedna.co/p/ultimate-beginners-guide-to-dax Advanced DAX Combinations - portal.enterprisedna.co/p/advanced-dax-combinations Mastering DAX Calculations - portal.enterprisedna.co/p/mastering-dax-calculations ***** Related Support Forum Posts ***** Create Custom Dynamic Groups In Power BI - Advanced DAX - forum.enterprisedna.co/t/qq-create-custom-dynamic-groups-in-power-bi-advanced-dax/3525 Problem with Ranking (RankX), Showing all Customers - forum.enterprisedna.co/t/problem-with-ranking-rankx-showing-all-customers/299 Grouping Customers Evenly By Rank - forum.enterprisedna.co/t/grouping-customers-evenly-by-rank/4277/4 For more advanced DAX calculations to review see here - forum.enterprisedna.co/t/grouping-customers-evenly-by-rank/4277/4
Hi radhika maheshwari, thanks for posting your comment here in the video. This topic has been discussed several times in Enterprise DNA Forum. You might get the answers you are looking for. If you want to check it out here is the link: forum.enterprisedna.co/search?q=countrows%20function
I did it the following way but using [Sales Amount] instead of [Total Profit] in another DB: CustomerGroupSales = VAR CustomerSales = ADDCOLUMNS( SUMMARIZE( Sales, Customer[CustomerKey] ), "@Sales", [Sales Amount], "@Rank", RANKX( ALL(Customer[CustomerKey]),[Sales Amount]) ) VAR SalesAmt = SUMX( FILTER( CustomerSales, [@Rank] > MIN(CustomerGroup[Min]) && [@Rank]
Seems Awesome, will check out, not sure on performance due to context tarnsiition. I have a similar technique using calculate. Top Sales = CALCULATE ( [Total Sales], FILTER ( VALUES ( Customer[Customer ID] ), [Rank] MIN ( Segment[Min] ) ) )
Oh, thanks Mate. Had same insight while watching the vid. Use COUNTROWS () > 0 in filter context is one of the most stupid things I have ever seen on DAX. Seems like this guy should go read some books instead of teaching anyone.
Hi Sam, Thanks a lot for this powerBI series. In this video, I think there is some problem with customer group profits formula. If you see the %graph w.r.t month and year top50 group contributes the most. But when combined, the rest group contributes the most. Could you please check and advise me on this. Note : refer the visualisations at 13:25.
Hi Annaboina, This is due to additional Filter Context through Dates. Due to this only Customers falling within those dates are considered. Please enroll to EDNA free courses to understand Contexts and lot more in Power BI. You can also raise any specific questions in Comments there. portal.enterprisedna.co/p/ultimate-beginners-guide-to-dax portal.enterprisedna.co/p/ultimate-beginners-guide-to-power-bi
Hi Arul, glad that you appreciated our content! If you haven't yet, you can subscribe to our channel to see all our upcoming Power BI video tutorials. Cheers!
Hi Sam - great demo. Just one idea- I know that this is probably going outside of scope of the demo, but I think that the interesting idea would be to use variable here. Something similar to this: Customer Group Profits = CALCULATE( [Total Profits]; FILTER( VALUES( Customers[Customer Name] ); var customerRank= RANKX( ALL( Customers[Customer Name] ); [Total Profits]; ; DESC ) return COUNTROWS( FILTER( 'Customer Groups'; customerRank > 'Customer Groups'[Min] && customerRank 0 ) ) You evalute rank only once per iteration (customerRank). This also adds to the readability of the measure. Just a suggestion. I really enjoyed this demo.
I thought so too when he was making the Customer Groups table, but they actually don't overlap. In the formula he makes the rank greater than the min, but less than or equal to the max. So the buckets are distinct.
***** Related Links *****
Manage Multiple Date Calculations In Your Fact Table - Advanced Power BI Technique - blog.enterprisedna.co/manage-multiple-date-calculations-in-your-fact-table-advanced-power-bi-technique/
Optimizing Your Power BI Formula Using Advanced DAX Functions - blog.enterprisedna.co/data-segmentation-techniques-based-on-any-measure-advanced-dax/
Data Segmentation Techniques Based On Any Measure - Advanced DAX - blog.enterprisedna.co/data-segmentation-techniques-based-on-any-measure-advanced-dax/
***** Related Course Modules *****
Ultimate Beginners Guide to DAX - portal.enterprisedna.co/p/ultimate-beginners-guide-to-dax
Advanced DAX Combinations - portal.enterprisedna.co/p/advanced-dax-combinations
Mastering DAX Calculations - portal.enterprisedna.co/p/mastering-dax-calculations
***** Related Support Forum Posts *****
Create Custom Dynamic Groups In Power BI - Advanced DAX - forum.enterprisedna.co/t/qq-create-custom-dynamic-groups-in-power-bi-advanced-dax/3525
Problem with Ranking (RankX), Showing all Customers - forum.enterprisedna.co/t/problem-with-ranking-rankx-showing-all-customers/299
Grouping Customers Evenly By Rank - forum.enterprisedna.co/t/grouping-customers-evenly-by-rank/4277/4
For more advanced DAX calculations to review see here - forum.enterprisedna.co/t/grouping-customers-evenly-by-rank/4277/4
This course has got to be the best introduction to DAX anywhere... So clear and systematic. Truly excellent training, thank you Sam!
What is the purpose of countrows function here? I did't understand it quite well.
Hi radhika maheshwari, thanks for posting your comment here in the video. This topic has been discussed several times in Enterprise DNA Forum. You might get the answers you are looking for.
If you want to check it out here is the link: forum.enterprisedna.co/search?q=countrows%20function
I did it the following way but using [Sales Amount] instead of [Total Profit] in another DB:
CustomerGroupSales =
VAR CustomerSales =
ADDCOLUMNS(
SUMMARIZE(
Sales,
Customer[CustomerKey]
),
"@Sales", [Sales Amount],
"@Rank", RANKX( ALL(Customer[CustomerKey]),[Sales Amount])
)
VAR SalesAmt =
SUMX(
FILTER(
CustomerSales,
[@Rank] > MIN(CustomerGroup[Min]) &&
[@Rank]
Seems Awesome, will check out, not sure on performance due to context tarnsiition. I have a similar technique using calculate.
Top Sales =
CALCULATE (
[Total Sales],
FILTER (
VALUES ( Customer[Customer ID] ),
[Rank] MIN ( Segment[Min] )
)
)
Oh, thanks Mate. Had same insight while watching the vid.
Use COUNTROWS () > 0 in filter context is one of the most stupid things I have ever seen on DAX.
Seems like this guy should go read some books instead of teaching anyone.
Hi Sam,
Thanks a lot for this powerBI series.
In this video, I think there is some problem with customer group profits formula.
If you see the %graph w.r.t month and year top50 group contributes the most.
But when combined, the rest group contributes the most. Could you please check and advise me on this.
Note : refer the visualisations at 13:25.
Hi Annaboina,
This is due to additional Filter Context through Dates. Due to this only Customers falling within those dates are considered.
Please enroll to EDNA free courses to understand Contexts and lot more in Power BI. You can also raise any specific questions in Comments there.
portal.enterprisedna.co/p/ultimate-beginners-guide-to-dax
portal.enterprisedna.co/p/ultimate-beginners-guide-to-power-bi
Great content. You’ve really provided a great foundation, explained very clearly.
Really awesome, as a beginner of DAX it is a really good to start.
Hi Arul, glad that you appreciated our content! If you haven't yet, you can subscribe to our channel to see all our upcoming Power BI video tutorials. Cheers!
Hi Sam - great demo. Just one idea- I know that this is probably going outside of scope of the demo, but I think that the interesting idea would be to use variable here. Something similar to this:
Customer Group Profits =
CALCULATE( [Total Profits];
FILTER( VALUES( Customers[Customer Name] );
var customerRank= RANKX( ALL( Customers[Customer Name] ); [Total Profits]; ; DESC )
return COUNTROWS(
FILTER( 'Customer Groups';
customerRank > 'Customer Groups'[Min]
&& customerRank 0 ) )
You evalute rank only once per iteration (customerRank). This also adds to the readability of the measure.
Just a suggestion.
I really enjoyed this demo.
Great idea to use variables. I will add that tip to my notes on the course!
Sam your buckets do overlap though..great example of dax. Many thanks Dimitris
I thought so too when he was making the Customer Groups table, but they actually don't overlap. In the formula he makes the rank greater than the min, but less than or equal to the max. So the buckets are distinct.
Yes as advised below, you fix this in the formula using
brilliant!
Really good work
Unbelievable.