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.
Hi All,
I have two measures Sales and Performance. I also have a Date(YYYY) column in the same table which is dated until x years i.e 2020, 2019, 2018, 2017, 2016, etc
If I select 2018 from the Date slicer, I need to show last 5 years of Sales in each row of the table. Another row holding the variance between the Sales years.
Example:
2018 | 2017 | 2016 | 2015 | 2014 | |
Sales | 350 | 300 | 275 | 260 | 255 |
var | 50 | 25 | 15 | 5 |
Challenge, I am unable to get the last 5 years data as a column in a table and also find the difference between the sales dynamically.
Could you please help me as to how I can achieve the solution? thanks
Solved! Go to Solution.
Hi @Sammy_01 ,
Please check the attached .pbix file.
Best regards
Icey
If this post helps, then consider Accepting it as the solution to help other members find it faster.
Hi @Sammy_01 ,
Please check the attached .pbix file.
Best regards
Icey
If this post helps, then consider Accepting it as the solution to help other members find it faster.
@Sammy_01 , With a separate year table , you should be able to get diff
This Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])))
Last Year = CALCULATE(sum('order'[Qty]),filter(ALL('Date'),'Date'[Year]=max('Date'[Year])-1))
diff = [This Year]-[Last Year ]
diff % = divide([This Year]-[Last Year ],[Last Year ])
In matrix use show on row - https://www.burningsuit.co.uk/blog/2019/04/7-secrets-of-the-matrix-visual/
@amitchandak thanks for your solution. I am able to get the difference, however, when I add the Variance row in the matrix table, I get the value of the difference in the Total column.
How do I make sure to get values as the above table?
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 | |
95 | |
77 | |
65 | |
53 |
User | Count |
---|---|
144 | |
105 | |
102 | |
89 | |
63 |