Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
I have a list of clients and would like to be able to show their Rank in a given month for each month.
Example: Client1 ranked as our highest client (1) in January, but in February they dropped to our 3rd highest client (3). I would like to display the columns on the page as:
Client Name | Gross Margin Month to date | Rank this month | GM Last Month | Rank Last Month | Change in Rank Up or Down arrows
For what it is worth, Gross Margin is a RankX modeled Measure based on various other data elements.
Solved! Go to Solution.
Hi @jeremyguzman ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a table.
Calendar = CALENDAR(DATE(2023,1,1),DATE(2023,12,31))
(3) We can create measures.
GMLastMonth =
var _lastdate=EOMONTH(MAX('Table'[date]),-1)
return CALCULATE([GrossMargin], FILTER(ALL('Table'),YEAR('Table'[date])= YEAR(_lastdate) && MONTH('Table'[date])=MONTH(_lastdate) && 'Table'[Client Name]=MAX('Table'[Client Name])))
GrossMarginMTD =
CALCULATE([GrossMargin], FILTER(ALL('Table'),YEAR('Table'[date])=YEAR(MAX('Table'[date])) && MONTH('Table'[date])=MONTH(MAX('Table'[date])) && 'Table'[Client Name]=MAX('Table'[Client Name])))
RankLastMonth = RANKX(ALLSELECTED('Table'[Client Name]), [GMLastMonth], , DESC)
RankThisMonth = RANKX(ALLSELECTED('Table'[Client Name]), [GrossMarginMTD], , DESC)
ChangeInRank = [RankLastMonth] - [RankThisMonth]
Flag = IF('Table'[ChangeInRank] >0 ,2,1)
(4)Setting the Conditional Format and then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jeremyguzman ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a table.
Calendar = CALENDAR(DATE(2023,1,1),DATE(2023,12,31))
(3) We can create measures.
GMLastMonth =
var _lastdate=EOMONTH(MAX('Table'[date]),-1)
return CALCULATE([GrossMargin], FILTER(ALL('Table'),YEAR('Table'[date])= YEAR(_lastdate) && MONTH('Table'[date])=MONTH(_lastdate) && 'Table'[Client Name]=MAX('Table'[Client Name])))
GrossMarginMTD =
CALCULATE([GrossMargin], FILTER(ALL('Table'),YEAR('Table'[date])=YEAR(MAX('Table'[date])) && MONTH('Table'[date])=MONTH(MAX('Table'[date])) && 'Table'[Client Name]=MAX('Table'[Client Name])))
RankLastMonth = RANKX(ALLSELECTED('Table'[Client Name]), [GMLastMonth], , DESC)
RankThisMonth = RANKX(ALLSELECTED('Table'[Client Name]), [GrossMarginMTD], , DESC)
ChangeInRank = [RankLastMonth] - [RankThisMonth]
Flag = IF('Table'[ChangeInRank] >0 ,2,1)
(4)Setting the Conditional Format and then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
98 | |
90 | |
83 | |
70 | |
67 |
User | Count |
---|---|
113 | |
104 | |
101 | |
73 | |
65 |