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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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