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 Experts,
I have table that is showing me the value of a certain variable for a customer at a given date (table shows year).
noting that this table has been sliced to show a specific month/customer/variable:
I would like to be able to get the variance between each date after filtering these table.
Is that possible in DAX?
Thx in advance!
Ex:
Year | Customer | Variable_Value | Variance |
2018 | A | 2 | |
2019 | A | 4 | 100% |
2020 | A | 6 | 50% |
2021 | A | 3 | -50% |
And if I filter to only 2 years:
Year | Customer | Variable_Value | Variance |
2018 | A | 2 | |
2021 | A | 3 | 50% |
@Vladracs , Create a separate date/year table and then have a measure like
//Only year vs Year, not a level below
This Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('Table'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
HI thx for answering, however as I mentioned, I know how to get last year values. that's not what I am aiming here. I need to be able to calculate the diff between 2 values in the table after slicing it.
so if the user filter for 2018 and 2022, that is not "last year". But the value should be 2022 value / 2018 value. if I filter for 2019 and 2021, same thing 2021 / 2019's value.
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 |
---|---|
110 | |
99 | |
80 | |
64 | |
57 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |