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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register 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.
User | Count |
---|---|
9 | |
8 | |
5 | |
4 | |
3 |