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
Anonymous
Not applicable

Count over Measure with Conditions

Hi guys.

 

I am trying to get a Count over a measure with specific conditions, like value between 20 and 25% and value over 25%.

 

I honestly have no clue on how to do it. I built this table to picture what I am looking for, I think it's clearer this way:

 

Untitled.png

 

 

 

 

 

 

 

 

 

 

 

 

Any ideas?

 

I don't need all the code, maybe with a few hints I can do it.

 

Thanks in advance! Smiley Happy

1 ACCEPTED SOLUTION

Hi @Anonymous,

 

Based on the PBIX file you shared I believe that the  issue is based on context because in the measure you created you are making based on Name and Date but on the count of the percentages you are not giving that same context so the result is not correct.

 

Create a column based on the date from your table:

 

MONTH = FORMAT(TABLE[DATE];"mm-yyyy")

Then create the following measure:

 

COUNT % 20 - 25 =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            ALL ( TABLE[NAME]; TABLE[MONTH] );
            TABLE[NAME];
            TABLE[MONTH];
            "% Count"; [MEASURE TO BE COUNTED]
        );
        [MEASURE TO BE COUNTED] >= 0,2
            && [MEASURE TO BE COUNTED] <= 0,25
    )
)

 

 

Believe this should work, but check the PBIX file I have return to you trough private message.

 

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

12 REPLIES 12

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.