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
Anonymous
Not applicable

Summarize two bars to one bar

Hello together,

 

I have a bar chart where you can see accounting indicators (1C, 1E, 1F, 1W, 2W…) per month. For each indicator Power BI makes a new bar in the chart. Is it possible to summarize two indicators (e.g. 1W + 2W) in one bar together? Maybe with a measure or something like this? In the attached picture you can see the two bars with should be one bar together.

 

Thanks

 

bar chartbar chart

1 ACCEPTED SOLUTION

@Anonymous

 

As MattAllington said, we can create a column with formula like below.

New CSW Flag = 
IF (
    'CCCE WSPs'[CSW Flag] = "1W"
        || 'CCCE WSPs'[CSW Flag] = "2W",
    "1W+2W",
    'CCCE WSPs'[CSW Flag]
)

Summarize two bars to one bar_1.jpg

Then drag this new created column to Column series.

Summarize two bars to one bar_2.jpg

 

Best Regards,

Herbert

View solution in original post

4 REPLIES 4

Deutscher?  I remember the "Hallo zusammen" translation 🙂

 

There are a few ways of doing this, but it depends on what you are trying to do more broadly.    You can hard code a measure that joins 2 together, but then you will need to hard code measures for every other item too.  You could create a calculated column that combines 2 togehter, and then you can just drop the column on the axis to get the result.



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
Anonymous
Not applicable

Gut aufgefasst! 🙂

 

Hoe does it work excactly? I tried this measure here but it doesn´t work:

 

Measure = CALCULATE(COUNTROWS('CCCE WSPs');'CCCE WSPs'[CSW Flag]="1W") + CALCULATE(COUNTROWS('CCCE WSPs');'CCCE WSPs'[CSW Flag]="2W")   (CSW Flag are the accounting indicators)

 

How do you make it with the calculated columns? It doesn´t work either...

 

 

 

@Anonymous

 

As MattAllington said, we can create a column with formula like below.

New CSW Flag = 
IF (
    'CCCE WSPs'[CSW Flag] = "1W"
        || 'CCCE WSPs'[CSW Flag] = "2W",
    "1W+2W",
    'CCCE WSPs'[CSW Flag]
)

Summarize two bars to one bar_1.jpg

Then drag this new created column to Column series.

Summarize two bars to one bar_2.jpg

 

Best Regards,

Herbert

Anonymous
Not applicable

@v-haibl-msft thanks a lot! Now I´m getting it 🙂

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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