Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello!
I'm trying to brake my bad habit of adding columns to arrive at a desired outcome, and instead create measures when possible.
I believe this is a fairly simple problem, but I cannot solve it: I simply want a MEASURE to rank the dates in the following table visual (you can access the pbix and data file HERE😞
I simply want to add a MEASURE that 'ranks' these in ascending order. I tried to use both COUNTROWS and RANKX, but could not produce the outcome I'm looking for. In the end, I want the measure to be added to the table visual, and populate a value to the right of each date that ranks each respective date.
I think this logic is what I'm after: I want the measure to iterate through the list, and compare each row to the MIN date in the row, and COUNT that row--adding to the count each time that condition is TRUE.
Thanks for the consideration.
Solved! Go to Solution.
Hi @ccakjcrx
Try this MEASURE
Index =
RANKX (
ALLSELECTED ( Sheet1[Month Year] ),
CALCULATE ( SELECTEDVALUE ( Sheet1[Month Year] ) ),
,
ASC
)
HEY!
Thanks for responding. I probably should have included this in my original post.
This is the outcome I am looking for:
An index value would accomplish this, but I don't know how to get this via a MEASURE
Hi @ccakjcrx,
If you column stored the normal date value, you can try to use below measure to calculate the rank as the index:
Index =
COUNTX (
FILTER ( ALL ( Table ), [Month Year] <= MAX ( [Month Year] ) ),
[Month Year]
)
Regards,
Xiaoxin Sheng
@Anonymous
Hey!
Thanks for helping me out.
I applied your measure, but got the 14 for each row--rather than showing 1 for the first row, 2 for the second row, etc. You can download my .pbix file HERE
I want to do this in a MEASURE, but I'm not sure it is possible 😞
Hi @ccakjcrx
Try this MEASURE
Index =
RANKX (
ALLSELECTED ( Sheet1[Month Year] ),
CALCULATE ( SELECTEDVALUE ( Sheet1[Month Year] ) ),
,
ASC
)
Hi @Zubair_Muhammad ,
I have tried this, but this does gives the desired ranking.
Please refer the image below
Please, let me know your valuable suggestions.
Thank you 🙂
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 32 | |
| 27 | |
| 25 |