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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
AhmadImbaidin
Frequent Visitor

calculation groups and conditional formatting issue

Hello everone,

 

am facing an issue with conditional formatting when am using the matrix visual with calculation groups.

 

As you will see in the picture below, the conditional formatting for the expenses lines will give me a positive variance% as the actual is higher than the budget or the last year 

 

Screenshot 2024-03-28 233858.png

is there a way to multiply the expense lines with -1? here is my data table in case it helps.

Screenshot 2024-03-27 124551.png

 

if i need to change the data setup please infrom me what is the best way to do so.

 

Thank you all 

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

I recommend using SWITCH to achieve this. In practice this would be something like this:

P&L measure = var _line = MAX('Table'[Account]) return
SWITCH(TRUE(),
_line = "Total Other Exp.", -1*[P&L SUM],
_line = "Revenue" , [P&L SUM])


Here you should include logic for all the different cases. The two above are just examples. [P&L SUM] should contain sum of relevant accounts. Additionally I do hope your data is mock data. It is not a good idea to post accounting data to any forum.


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ValtteriN
Super User
Super User

Hi,

I recommend using SWITCH to achieve this. In practice this would be something like this:

P&L measure = var _line = MAX('Table'[Account]) return
SWITCH(TRUE(),
_line = "Total Other Exp.", -1*[P&L SUM],
_line = "Revenue" , [P&L SUM])


Here you should include logic for all the different cases. The two above are just examples. [P&L SUM] should contain sum of relevant accounts. Additionally I do hope your data is mock data. It is not a good idea to post accounting data to any forum.


I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors