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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Dear all, I am new to using dax and was wondering if you could help. In the report below I was trying to calculate the % change where the report is from multiple table sources. The data is in a way so there are multiple dates from each underlying table, hence I just used the month number to remove the issue of showing multiple lines as the sale value is a calculation based on the totals for the month. In this, I was trying to calculate the % change based on the prior row. I have seen many examples of this where a clear date/month / year, is straightforward, although I was trying to do this based on the Line ref (as shown below).
The calculations are as follows:
Hi TamerJ1 , thank you for your help with this, I got the reference number in order, and that worked (thanks, I would have not thought of putting the rankx in the date table by Month & year). But now I have a different (but related issue) in calculating the prior row. The result I get is the same value as the net sales in the same row. I tried removefilter() and all() and I get the same result.
The 'Date'[sRef] is the new fields with the rank (as per the above suggestion. so 'Date'[sRef] -1 gives the correct index. The only challange is getting the correct [Net Sales) which is a calculated measure (not on a table)
Hi @pjukone
easiest way would be by creating a new calculated column in the Date table: Year-Month sequential number. For example you can try
RANKX (
'Date',
'Date'[Year] * 100 + 'Date'[Month],,
ASC,
DENSE
)
then you can minus 1 to get to the orevious month comfortably.
User | Count |
---|---|
15 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
29 | |
18 | |
15 | |
7 | |
6 |