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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply

Count rows where sum is greater than [defined value]

I have screenshots of the excel equivalent.  I'd like to find sales_id that have sales greater than 3000.  All help is appreciated!sales_summary.pngsales_details.png

 

 

6 REPLIES 6
Phil_Seamark
Microsoft Employee
Microsoft Employee

HI @KUNGFUPANDA559

 

If you add the following calculated measure to your model, you can then set the filter to only show when it equals 1

 

Filter Measure = IF ( SUM('Table1'[SALES_TOTAL]) > 3000 , 1 , 0)

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

@Phil_Seamark

 

The next question would be filtering based on the results, and counting rows.  My assumptions are it'd be written similar to :

 

Filter Measure = IF ( SUM('Table1'[SALES_TOTAL]) > 3000 , 1 , 0)
Filter Count= CALCULATE(COUNTROWS(FILTER MEASURE),FILTER MEASURE = 1)

 

My filter count field does not work in this situation.  

Anonymous
Not applicable

Try this

 

Filter Count = CALCULATE(COUNTROWS('table1'),FILTER(financials,CONTAINSROW({1},([Filter Measure]))))

There must be something missing.  When i select matrix visualization.  I see 1,0 broken out by sales_id.  However when i use the card visualization it says "blank" as measure value (more blanks? first value blank?  does not show count of records)

@KUNGFUPANDA559 

 

I have made some test. However I did not encounter your issue. Please refer:

 

Expressions for measure Filter Measure and Filter Count:

 

Filter Measure =
IF ( SUM ( 'Table1'[SALES_TOTAL] ) > 3000, 1, 0 )
Filter Count =
CALCULATE (
    COUNTROWS ( Table1 ),
    FILTER ( Table1, Table1[Filter Measure] = 1 )
)

Capture.PNG

 

As you can see I got Matrix and Card. Everything works fine. So in your scenario, could you please share us your using measure expressions? And how did you define the Matrix and Card? Could you please share us some screenshots about them? 

 

Also, it will be more helpful if you can share us some sample data which can help us reproduce your issue.

 

Thanks,
Xi Jin.

@v-xjiin-msft

 

The issue may have been the date filter context of another column.  In the end the correct measure was:

 

CALCULATE(DISTINCTCOUNT(Sales[Sales_ID]),FILTER(VALUES(Sales[Sales_ID]),[YTDSales]>3000))

 

thanks for your direction! 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.