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

Count the frequency of a measure

Hello, i am relatively new to POWER BI and DAX. Usually i am able to learn by watching youtube trainings or google, but i have something i want to do that i could not solve.

 

Ok, here is my data set.....

pic1.jpg

 

And i was able to make a neat summary by making measures (TotalSales, TotalTarget, and Achievement)

TotalSales =  SUM(Sheet1[Sales])

TotalTarget = SUM(Sheet1[Target])

Achievement = [TotalSales] / [TotalTarget]

pic2.jpg

 

What i want to do next that i could not figure out is to summarize the measure ACHIEVEMENT into something like this which basically shows the number of people who achieved 100% or higher per Area.

pic3.jpg

 

It seems like a simple thing but im stuck. Any help would be appreciated. Thanks!

1 ACCEPTED SOLUTION

Hi @EdAbada

 

Try this Measure

 

Achievers > 100% =
COUNTROWS (
    FILTER ( ALLEXCEPT ( Sheet1, Sheet1[Area] ), CALCULATE ( [Achievement] ) > 1 )
)

 

Photo10.png 


Regards
Zubair

Please try my custom visuals

View solution in original post

8 REPLIES 8
BeemsC
Resolver III
Resolver III

Hello,

For this i recommend using the CALCULATE() function.
Ur formula would look something like:
Formula = CALCULATE(SUM('sheet1'[Sales]);'sheet1'[target] => 100)

Try recreating this in your own pbi file, since this was from memory.

Good luck

Edit: See below

Hi BeemsC, thanks for replying.

 

I'm still trying to make sense of your formula, however, i think the formula should count the frequency of the measure Achievements with results  of 100% and up and not using the measure Target which is in the formula you provided.  Appreciate the reply though...

 

 

As i said, since i dont have data, the formula might not be 100% correct.
If you don't understand give me some sample data, and ill make it for you

I can send you the pbix file that i have but i dont know how to attach a file here. Maybe you can pm me an email address i can send to?

 

The small data im using is the one in my first post (first pic). The 2nd pic is the matrix i made using a few measures that i created. The 3rd pic is the table or matrix that i hope to make to show how many people in each area having 100% and higher achievement.

 

Thanks for your assistance on this.

It seems i got the wrong idea earlier, my bad.
How about the following:

Achievers > 100 = CALCULATE(COUNT(Sheet1[Achievement]);Sheet1[Achievement] > 1)

 

 

Hi @EdAbada

 

Try this Measure

 

Achievers > 100% =
COUNTROWS (
    FILTER ( ALLEXCEPT ( Sheet1, Sheet1[Area] ), CALCULATE ( [Achievement] ) > 1 )
)

 

Photo10.png 


Regards
Zubair

Please try my custom visuals

Thats it! Thank you Zubair_Muhammad for your measure.  It works! Smiley Happy

 

BeemsC, i also tried your measure but it gives me an error not sure why. Nevertheless, thank you for your help. Smiley Happy

pic4.jpg

 

 

Ill try to create something myself for now

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.