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 dataset where I have current year sales and last year sales at product and category leve. I need to calculate Year over year %. I was able to get YOY% but I have requirement where I need to show that YOY% value for category level even though I have product selected in the table.
YOY% = Divide(sales-last_yr_sales,last_yr_sales)
So if you see look at screenshot in the left table I have yoy% showing at product level, but instead I need a way to show yoy% at category level like in the right table even when product is selected. So in my case in left table i need to show yoy% for apparel to be 30% and smartdevices to be 25%. Can someone please help me with this?
Thanks in advance.
Solved! Go to Solution.
@Anonymous,
sales and last_yr_sales are measures, right? If so, you can create the following measure to get expected result.
Measure = DIVIDE(CALCULATE([sales],ALLEXCEPT(Table1,Table1[category]))-CALCULATE([last yr sales],ALLEXCEPT(Table1,Table1[category])),CALCULATE([last yr sales],ALLEXCEPT(Table1,Table1[category])))
For more details, please check attached PBIX file.
Regards,
Lydia
@Anonymous,
sales and last_yr_sales are measures, right? If so, you can create the following measure to get expected result.
Measure = DIVIDE(CALCULATE([sales],ALLEXCEPT(Table1,Table1[category]))-CALCULATE([last yr sales],ALLEXCEPT(Table1,Table1[category])),CALCULATE([last yr sales],ALLEXCEPT(Table1,Table1[category])))
For more details, please check attached PBIX file.
Regards,
Lydia
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 |
---|---|
112 | |
97 | |
82 | |
67 | |
61 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |