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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
eltonxavier
Regular Visitor

Count values and group them by category (without the category!)

Hello guys,

 

I have a table called Audits like this:

 

EXCEL_2018-09-18_10-21-10.png

 

And the customer wants to see the audits grouped by category. The issue here is that we don't have the categories. The result table should look like:

 

EXCEL_2018-09-18_10-21-29.png

 

It sounds simple but I have no idea how to do it. Any ideas, please?

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @eltonxavier,

 

Please follow the steps below.

 

1. Go to Query Editor and Rename the column to Four Pillars and PPE;

2. Select the two columns Four Pillars and PPE and Unpivot columns.

 

Power query.png

3. Rename the Attribute to Category and Close and Apply.

4. Go to Modeling tab and create two measures with the formula below.

 

Safe = var temp= CALCULATE(COUNT(Table1[Value]),FILTER('Table1','Table1'[Value]="Yes")) return IF(ISBLANK(temp),0,temp)

UnSafe = var temp= CALCULATE(COUNT(Table1[Value]),FILTER('Table1','Table1'[Value]="No" )) return IF(ISBLANK(temp),0,temp)

5. Create the matrix like below.

output.PNG

 

More details, you could refer to the attachment.

 

Hope this can help you!Smiley Very Happy

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
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

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @eltonxavier,

 

Please follow the steps below.

 

1. Go to Query Editor and Rename the column to Four Pillars and PPE;

2. Select the two columns Four Pillars and PPE and Unpivot columns.

 

Power query.png

3. Rename the Attribute to Category and Close and Apply.

4. Go to Modeling tab and create two measures with the formula below.

 

Safe = var temp= CALCULATE(COUNT(Table1[Value]),FILTER('Table1','Table1'[Value]="Yes")) return IF(ISBLANK(temp),0,temp)

UnSafe = var temp= CALCULATE(COUNT(Table1[Value]),FILTER('Table1','Table1'[Value]="No" )) return IF(ISBLANK(temp),0,temp)

5. Create the matrix like below.

output.PNG

 

More details, you could refer to the attachment.

 

Hope this can help you!Smiley Very Happy

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.