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
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
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.