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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors