Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
sraj
Responsive Resident
Responsive Resident

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)

 

Capture 2.PNG

Capture.PNG

 

Thanks,

Seema Rajan.

1 ACCEPTED SOLUTION
parry2k
Super User
Super 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.

 

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

9 REPLIES 9
parry2k
Super User
Super User

@sraj yes you can accept both solutions, better you do it, click "Accept as solution"



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@sraj 

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>>
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

sraj
Responsive Resident
Responsive Resident

@parry2k 

 

That worked!!  Can you please accept botht the posts as solutions if you are able to?

 

Thanks Again!!

parry2k
Super User
Super 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.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

sraj
Responsive Resident
Responsive Resident

@parry2k 

Hi,
 
I am unable to respond again to your response and very new to all this...learning as it goes. 
Can you please specify how I can add the else value?
 
 
   
sraj
Responsive Resident
Responsive Resident

@parry2k  for some reason I am unable to respond to your reply.  That worked wonderfully, is it possible to do the same with some total numbers in place of the percent value in the measure you provided?

 

Capture 2.PNGCapture.PNG

parry2k
Super User
Super User

@sraj did you tried the measure I provided, turn on the total and it should work.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

sraj
Responsive Resident
Responsive Resident

Under the two values  on the table (76.25 - 76.96 = - 0.71)

parry2k
Super User
Super 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.

 

 

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.