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
hanr
Frequent Visitor

For a unique group calculate percentages for check column.

If I have a grouped table like:

 

 

A      B     C   D   D Count

A1    14   a    Y   2

A1    14   a    N  14

A1    20   b    N  20

A2    21   a    N   9

 

where D is the count of the number of yes/nos for that group, how would I check what percentage of unique groups have a Yes in them? In this example it would 33%. 

 

2 REPLIES 2
Mariusz
Community Champion
Community Champion

Hi @hanr 

You can create this two measures

Distinct Group Count = 
COUNTROWS(
    GROUPBY( 
        Table1,
        Table1[A],
        Table1[B],
        Table1[C]
    )
)
% of Groups with yes = 
DIVIDE(
    CALCULATE(
        [Distinct Group Count],
        Table1[D] = "Y"
    ),
    [Distinct Group Count]
)
Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski



v-xicai
Community Support
Community Support

Hi @hanr ,

 

You can create measure like DAX below.

 

Measue1=DIVIDE(COUNT('Table'[D]),CALCULATE(COUNT('Table'[D]),FILTER(ALL('Table'),'Table'[A]=MAX('Table'[A]))))

Or could you please share your sample data and desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.

 

Best Regards,

Amy

 

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.