cancel
Showing results 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

Regular Visitor

## Percentage of filtered data category of total in data category

please can someone help me solve this seemingly easy problem.

White , Open

White, Closed

Red, Closed
Blue, Open

Green, Closed

Green, Open

White, Closed

White, Closed

Red, Closed

White, Open

Green, Open

Green, Open

Black, Closed

Blue, Closed

Blue, Open

Red, Open

White, Closed

White, Closed

White, Open

White, Open

Of this data set. 9 are white. If I than filter on closed 5 are white. Hence 5/9 55.5% are White closed.
I want this to show in a report table.

Colour, Filtered Colour Count, Unfiltered Colour Count, Filtered as % of Unfiltered Colour Count.

1 ACCEPTED SOLUTION
Regular Visitor

Thanks Smoupre. That helped me figure it out.

Solution:

MyMeasure= COUNTA(Data[Colour[) / CALCULATE( COUNTA(Data[Colour]) , ALL(Data[Open/ Closed]))

2 REPLIES 2
Super User

You would probably be better off with a measure instead of custom columns, something like:

`MyMeasure = COUNTA([Colour])/CALCULATE(COUNTA([Colour]),ALL(Table))`

Then, as you filter in your report by color or status or if you put this in a matrix, the measure will calculate out correctly.

Become an expert!: Enterprise DNA
External Tools: MSHGQM
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Regular Visitor

Thanks Smoupre. That helped me figure it out.

Solution:

MyMeasure= COUNTA(Data[Colour[) / CALCULATE( COUNTA(Data[Colour]) , ALL(Data[Open/ Closed]))

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors