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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
RyanAppel
New Member

Compare One Group of Company Against Rest of Company

I am looking to compare the gross margin of my company's different branches against the entire company's performance. My company is split into 10 different branches. I am building line graphs over time to show gross margin performance and would like to compare branch XYZ against my company's overall margin numbers for the same time period. My first solution was to use groups and create group 1: branch XYZ and group 2: remaining branches. This does not accomplish what I am looking for as each time I substitute a different branch, the overall company margin performance changes due to branches being substituted in and out. I need the overall company margin performance line to remain constant in each graph I am producing. See below for screenshot of issue. I want the dark blue line to keep the same values it has in the upper graph as it does when comparing our midwest branch to the rest of the company shown in the lower graph.

 

RyanAppel_0-1715207573147.png

 

1 ACCEPTED SOLUTION
v-zhouwen-msft
Community Support
Community Support

Hi @RyanAppel ,

Regarding your question, I think it is possible to create measures and implement them using the 'ALL' function.

ALL function (DAX) - DAX | Microsoft Learn

The Table data is shown below:

vzhouwenmsft_0-1715219578655.png

Please follow these steps:
1. Use the following DAX expression to create a measure

This branch = SUM('Table'[Value])

2.Use the following DAX expression to create a measure

Total = CALCULATE(SUM('Table'[Value]),ALL('Table'[Branches]))

3.Final output

vzhouwenmsft_1-1715219682634.pngvzhouwenmsft_2-1715219697044.png

 

View solution in original post

2 REPLIES 2
v-zhouwen-msft
Community Support
Community Support

Hi @RyanAppel ,

Regarding your question, I think it is possible to create measures and implement them using the 'ALL' function.

ALL function (DAX) - DAX | Microsoft Learn

The Table data is shown below:

vzhouwenmsft_0-1715219578655.png

Please follow these steps:
1. Use the following DAX expression to create a measure

This branch = SUM('Table'[Value])

2.Use the following DAX expression to create a measure

Total = CALCULATE(SUM('Table'[Value]),ALL('Table'[Branches]))

3.Final output

vzhouwenmsft_1-1715219682634.pngvzhouwenmsft_2-1715219697044.png

 

This solution worked, thank you!

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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