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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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