Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a table that is by Contract, Period (YYYYMM). I have a measure that is grabbing the previous record based on the Period column. This works great when the previous record is in the same year, but when I go from 202101 to 202012, my measure will not work. I am looking for some guidance on the best approach to grab previous record when it switches years based on my Period column.
Solved! Go to Solution.
@mkoontz , Create a rank on YYYYMM in you date table.
a new column
Period Rank = RANKX(all('Date'),'Period'[year period],,ASC,Dense)
try measures like these examples
This Period = CALCULATE( [measure for column ($)], FILTER(ALL('Period'),'Period'[Period Rank]=max('Period'[Period Rank])))
Last Period = CALCULATE( [measure for column ($)], FILTER(ALL('Period'),'Period'[Period Rank]=max('Period'[Period Rank])-1))
@mkoontz , Create a rank on YYYYMM in you date table.
a new column
Period Rank = RANKX(all('Date'),'Period'[year period],,ASC,Dense)
try measures like these examples
This Period = CALCULATE( [measure for column ($)], FILTER(ALL('Period'),'Period'[Period Rank]=max('Period'[Period Rank])))
Last Period = CALCULATE( [measure for column ($)], FILTER(ALL('Period'),'Period'[Period Rank]=max('Period'[Period Rank])-1))
@amitchandak Thank you for the quick reply. Greatly appreciated. Your solution worked great for me.
Thank you again.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |