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
pbrainard
Helper III
Helper III

Multiple type counts in bar chart

I feel like this should be easy to achieve and maybe I'm trying too early in the AM. 🙂

 

I have about 10000 records of incident reports. Each incident report contains multiple incident types. I want to be able to create a bar chart like the one below (which was done in Tableau using Measure Names and Measure Values). Can't figure out the equivalent in Power BI.  A simple count of how many times a type shows up on incident reports. The types are represented as 0 = False and 1 = True. 

pbrainard_0-1655126324991.png

 

My types are measures:

pbrainard_0-1655130800571.png

 

 

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

Hi  @pbrainard ,

Currently, measures can be dragged to value or tooltips field, but can’t be dragged to legend or X-axis field in a bar chart.

You can create a table, the content of the column is the name of the measure, and put this column into it to display.

Here are the steps you can follow:

1. Use Enter data to create a table.

vyangliumsft_0-1655357701463.png

2. Create measure.

Measure =
SWITCH(
    TRUE(),
    MAX('Table2'[Group_measure])="MeasureA",[MeasureA],
    MAX('Table2'[Group_measure])="MeasureB",[MeasureB],
    MAX('Table2'[Group_measure])="MeasureC",[MeasureC],
    MAX('Table2'[Group_measure])="MeasureD",[MeasureD])

3. Result:

vyangliumsft_1-1655357701466.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @pbrainard ,

Currently, measures can be dragged to value or tooltips field, but can’t be dragged to legend or X-axis field in a bar chart.

You can create a table, the content of the column is the name of the measure, and put this column into it to display.

Here are the steps you can follow:

1. Use Enter data to create a table.

vyangliumsft_0-1655357701463.png

2. Create measure.

Measure =
SWITCH(
    TRUE(),
    MAX('Table2'[Group_measure])="MeasureA",[MeasureA],
    MAX('Table2'[Group_measure])="MeasureB",[MeasureB],
    MAX('Table2'[Group_measure])="MeasureC",[MeasureC],
    MAX('Table2'[Group_measure])="MeasureD",[MeasureD])

3. Result:

vyangliumsft_1-1655357701466.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

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.