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

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.

Reply
Hanspw
Helper I
Helper I

Invert values in a visual?

Hi.

 

Is it possible to reverse the values in a visual?


My dataset have negative values. Income is negative values, and cost i positive values. That is fine in a cost report, but in a profit loss statement i would like the income to be positive numbers and the costs to be negative values. Also there may be time that you would like to highligt some data in a graph and where invertet numbers makes more sense.

 

Is there a way to accomplish this by inverting the values in a matrix og graph, or some other way to revert the measures, without duplicating all the measures? (sound like lot of work and could get messy with actual measures, budget measures, forecast measures, and everything in with YTD, LYTD, total this year and total last year measures. I really dont want to duplicate everything.

1 ACCEPTED SOLUTION
vanessafvg
Super User
Super User

you can create a calculation group item  in tabular editor, and then use that  item, which is a measure to apply to all the measures in your model, by use of a slicer you apply the calculation group measure to your measure it and you can get the inverse, but it obviously depends on how you want to use it.

 

see pbix example, but you will need tabular editor to see the calculation item

 

https://www.sqlbi.com/tools/tabular-editor/  --> download tabular editor if you haven't already, its awesome

 

watch this video with the details  on how to use create the calculation group   https://www.youtube.com/watch?v=xS1t25_GsWw

 

i think you can probably use this code for your calculation item. depending on how you use it.

selectedmeasure() * -1

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
vanessafvg
Super User
Super User

i just saw this in linked in but not sure if its of any use to you?

 

https://www.linkedin.com/posts/daniilmaslyuk_powerbi-activity-6788412485411106816-HaBt





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Thank you for the tip. I think the calculation groups is what i am looking for, but this could be handy for a quick fix. But i am not able to test it, i cant see this option. Maybe my desktop application is not updated 😐

vanessafvg
Super User
Super User

you can create a calculation group item  in tabular editor, and then use that  item, which is a measure to apply to all the measures in your model, by use of a slicer you apply the calculation group measure to your measure it and you can get the inverse, but it obviously depends on how you want to use it.

 

see pbix example, but you will need tabular editor to see the calculation item

 

https://www.sqlbi.com/tools/tabular-editor/  --> download tabular editor if you haven't already, its awesome

 

watch this video with the details  on how to use create the calculation group   https://www.youtube.com/watch?v=xS1t25_GsWw

 

i think you can probably use this code for your calculation item. depending on how you use it.

selectedmeasure() * -1

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




I was looking at calculation groups yesterday for using actual, budget, forecast measures to YTD, LYTD, Last year calculated groups, but as i understood that wont work if i want to show lets say actual YTD; LYTD vs budget this year.

But i will look into using calculated groups for inverting data, thank you.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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