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

conditional count based on a the outcome of a sum

good day,
 
I'm trying to find the following:
below is a measure which sums up number of pallets. So far so good, this is working as intended. 
 
NumberOfPallets = CALCULATE(SUM(T_SalesData[Nr of Pallets Sold]),
FILTER(T_SalesData,
T_SalesData[DirectDelivery]="0"&&
T_SalesData[Delivery terms]<>"FCA"))
 
What I need to do now is to count the occasions where the outcome of above measure is for example lower than 3, or between 2 values.
 
Any suggestions how to go about this? I can't seem to figure it out. 
 
thanks
 
 
1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Try this pattern

 

Measure =
COUNTROWS (
    FILTER ( VALUES ( TableName[OccassionColumnName] ), [NumberOfPallets] < 3 )
)

View solution in original post

3 REPLIES 3
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Try this pattern

 

Measure =
COUNTROWS (
    FILTER ( VALUES ( TableName[OccassionColumnName] ), [NumberOfPallets] < 3 )
)
Anonymous
Not applicable

@Zubair_Muhammad 

 

thanks again for this and please disregard my other response. the one question I do still have on this topic is how I would add another filter(s), based on a column (field) in the underlying table. So, combining this filter based on the outcome of a measure and one or more filters on field(s) in my table. 

my trialling and errorring has not worked for me sofar. 

thanks

Anonymous
Not applicable

thanks @Zubair_Muhammad for the suggestion and I'd say this would be perfect, yet countrows would overstate my outcome as there could be multiple rows per my "key". I.e. I'm grouping the number of records (product codes per delivery) per day. I'm looking for the count of the sum of this grouped sum. Using countrows would end up showing each individual row (product code) per delivery which would match the "<3" condition no? 

 

I hope I make myself clear? 

 

 

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.