The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 |
---|---|
26 | |
12 | |
8 | |
8 | |
6 |
User | Count |
---|---|
30 | |
15 | |
12 | |
12 | |
7 |