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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

DAX Measure Count, group by, Filter.

Hello everyone,

 

I'm trying to write a meaure to Count the number of Puchase Contract if the Total Contract Consumptoin% exceeds 80% of the contract value.

Note: The Puchase Contract could have multiple items but i need the measure to count the Puchase Contract and apply the condition on the Contract Consumptoin% of total items per Puchase Contract (the percentage of the summed items).

 

Table= Contract

 

Abdullah2346_1-1692682475074.png

 

I would really apprecaite your support.

Thanks in advance.

3 REPLIES 3
JoeBarry
Solution Sage
Solution Sage

Hi @Anonymous 

Can you show me in a screenshot your expected outcome? Maybe create a table within your comment. And maybe if the data isn't sensitive a screenshot of a few lines of the table?

You can also try below. Presuming there is a Value in each Row, this will count all rows, therefore checking each consumption is over 80% 

 

Exceed 80% = CALCULATE(COUNTROWS(Contract]), KEEPFILTERS([Contract Consumption%]>= 0.8)

 

 

If you remove the Released Value from the Rows also after creating the measure from your Matrix, it should show you what you need. 

JoeBarry
Solution Sage
Solution Sage

Hi @Anonymous 

 

You can try this measure

 

Exceed 80% = CALCULATE(COUNT(Contract[Purchase Contract]), KEEPFILTERS([Contract Consumption%]>= 0.8)

 Thanks

Joe

Anonymous
Not applicable

Thanks alot Joe.

 

Exceed 80% = CALCULATE(COUNT(Contract[Purchase Contract]), FILTER(Contract,[Contract Consumption]>= 0.8))
 
I've tried the above measure but it will calculate the count on line item level.  The Puchase Contracts have multiple items so i need the logic of the measure to calculate (Count) for the summed values for each Puchase Contract. (by grouping by Puchase Contract if possible)
 
Please let me know if you need more illustration.
Thanks again for your support

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.