Forum Discussion
Subtracted value on Matrix or Table
Hi,
Is it possible to show the subtracted value on a matrix or a table for a measured value instead of the TOTAL.
(onsite%new =DIVIDE(SUM(date_detail[tot_num_onsite]),SUM(date_detail[Total OTV]))
Would like to see this (76.25 - 76.96 = - 0.71)
Thanks,
Seema Rajan.
sraj there are a few ways to do this, a simple one would be like this:
New Onsite % Measure = IF ( HASONEVALUE ( YourTable[YearColumn] ), [Onsite %new], CALCULATE ( [Onsite %new], YourTable[YearColumn] = 2021 ) - CALCULATE ( [Onsite %new], YourTable[YearColumn] = 2020 ) )Now use this measure in the matrix, few problems with this solution is that year is used as a fixed value in the measure and not very scalable but at least this will get you started.
✨ Follow us on LinkedIn
Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
9 Replies
- parry2kSuper User
sraj there are a few ways to do this, a simple one would be like this:
New Onsite % Measure = IF ( HASONEVALUE ( YourTable[YearColumn] ), [Onsite %new], CALCULATE ( [Onsite %new], YourTable[YearColumn] = 2021 ) - CALCULATE ( [Onsite %new], YourTable[YearColumn] = 2020 ) )Now use this measure in the matrix, few problems with this solution is that year is used as a fixed value in the measure and not very scalable but at least this will get you started.
✨ Follow us on LinkedIn
Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- srajResponsive Resident
Under the two values on the table (76.25 - 76.96 = - 0.71)
- parry2kSuper User
sraj you can put whatever logic you want in the else condition.
✨ Follow us on LinkedIn
Check my latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
- parry2kSuper User
New Onsite % Measure = IF ( HASONEVALUE ( YourTable[YearColumn] ), [Onsite %new], <<this is the else part, write whatever code you want here, and it will show in the total line>> )