Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi everyone I want to use Rankx to calculate a ranking for my data over the past year ignoring any entries in the days before. I tried the following: RANKX(DATESINPERIOD(Table[Date],MAX(Table[Date]),-1,YEAR),CALCULATE(SUM(Table[Amount])),,ASC,Dense)
However, the results are not correct. Can anyone advise please?
@JJ1214 ,You want Rank Last year data , what is group by ?
first create a measure like
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
or
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
or
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))
then try rank
RANKX(allselected(Table),[Year behind Sales],,ASC,Dense)
For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
Thank you very much for your response. I think I did not state my question correctly. I would like to have the daily sums per Customer group but only for the past year such that the ranking for the specific customer group ignores all values in the year before. Is that possible somehow? If I introduce a relative date filter in the visual, the ranking shows incorrect values.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 5 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 15 | |
| 14 | |
| 13 |