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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
ThuyTran
Regular Visitor

DISTINCT COUNT WITH CONDITION AS OF MATRIX TABLE

Hello everyone, 

I have an issue to perform distinct count in this Dim_Attribute table:

Indexreview_scoreAttributeValue
179.20%S6 100.00%
179.20%I1100.00%
179.20%F3 100.00%
179.20%F1 100.00%
179.20%I5100.00%
179.20%S7 100.00%
179.20%G1 100.00%
179.20%T266.00%
179.20%S3 66.00%
179.20%S566.00%
179.20%S2 66.00%
179.20%T1 66.00%
179.20%I3 0.00%
261.70%S6 100.00%
261.70%F1100.00%
261.70%F3 100.00%
261.70%G1 100.00%
261.70%S7 100.00%
261.70%I5100.00%
261.70%I1 0.00%
261.70%T2 0.00%
261.70%I30.00%
261.70%F4 0.00%
261.70%S266.00%
261.70%T1 66.00%
261.70%S366.00%
261.70%S566.00%

 

I try to distinct count the attribute with value >=75%. When i do the matrix it shows like 

ThuyTran_0-1709657246494.png

but when I do the count distinct on card it doesnt show correctly when I do this measure:

Green Attribute = CALCULATE (DISTINCTCOUNT(Dim_Attribute[Attribute], FILTER(AVERAGE(Dim_Attribute[Value])>=0.75))

It will count total number of attributes.

Would anyone please suggest me how to look at this matter? Should I do a group by index or how can i perform this?

Thank you very much in advance!

 

 

1 ACCEPTED SOLUTION

Thank you, I tried but it did not work so well.

But I figure out sth this morning. I unpivot the attribute colum into multiple columns. Then I put multiple VAR condition for each column >=75% a green and <75% as red.

then return will be sum of count of every attribute.

It's kinda manual but so far it's correct 🙂
much appreciate your help ~~

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @ThuyTran ,

 

Maybe you can modify your formula like below:

Green Attribute =
CALCULATE (
    DISTINCTCOUNT ( Dim_Attribute[Attribute] ),
    FILTER ( Dim_Attribute, AVERAGE ( Dim_Attribute[Value] ) >= 0.75 )
)

vkongfanfmsft_0-1709693834699.png

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you, I tried but it did not work so well.

But I figure out sth this morning. I unpivot the attribute colum into multiple columns. Then I put multiple VAR condition for each column >=75% a green and <75% as red.

then return will be sum of count of every attribute.

It's kinda manual but so far it's correct 🙂
much appreciate your help ~~

Anonymous
Not applicable

Hi @ThuyTran ,

 

Thanks for your feedback.

 

Best Regards,
Adamk Kong

ExcelMonke
Super User
Super User

Hello,

Apologies if I missed something here: what is the expected result?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





I want to count the value appearing in the matrix table (which are values >=75%) of the attribute. However, my distinctcount shows 20 (total number of attributes)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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