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.
Hello!
I have a question that I think will be simple to answer, but I can't seem to figure out the correct solution.
I have a variable, Year, as a slicer on my dashboard.
I have already created a measure called Cost per Client which was done by doing Cost per Client = DIVIDE(SUM('Table'[dollars paid]), [Client Count])
I am wanting to also display Cost per Client for the previous year, but want to keep my Year slicer for other data fields that I have. Year is the only date field that my data has. Is there a way to calculate Cost per Client for the previous year?
Thank you in advance!
Solved! Go to Solution.
Thank you for the help!
I was able to get it done by doing
Thank you for the help!
I was able to get it done by doing
Sure you can through Time Intelligence functions with DAX, you'll only need a Date column/field.
https://docs.microsoft.com/en-us/dax/previousyear-function-dax Look for the example in that link, basically it is what you are trying to achieve. It would be something similar to P_Year = CALCULATE( [Cost Per Client], PREVIOUSYEAR(Table[DateColumn])
Similar functions you can consult as well:
https://docs.microsoft.com/en-us/dax/sameperiodlastyear-function-dax
https://docs.microsoft.com/en-us/dax/parallelperiod-function-dax
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |