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
Gerald23
Helper I
Helper I

Count value and filter by other column

Hi Everyone,

 

I have a table that looks like this:

 

Order DateOrder NumberCustomer NumberArticle NumberQualtity OrderedSold PriceNP

SoldPrice-NP

(This is a calculated Column)

1-1-202212301789310.8012.81-2.01
2-2-20221240279080.003.33-3.33
13-2-20221251078964.6612.81-8.15
14-2-20221261423053.342.510.83
16-2-20221302548612.401.061.34
18-2-2022140868522013.9918.95-4.96

 

Now i have created a measure to calculate the number of different items that are sold below the NP price that looks like this

 

Count #sold cheaper NP = CALCULATE(COUNT(Data[SoldPrice-NP]), Data[SoldPrice-NP] < 0)

 

 
But now I also want a measure that counts all articles that are sold below the NP price. So I need to count the values in the Quantity Ordered column but only when SoldPrice-NP is below 0. How could I achieve this?
 
 
 
1 ACCEPTED SOLUTION
Gerald23
Helper I
Helper I

That was easier then I expected xD

 

I used the code below to achieve this

 

Count all article below 0 = CALCULATE(SUM(Data[Quantity Ordered]), Data[SoldPrice-NP] < 0)

View solution in original post

1 REPLY 1
Gerald23
Helper I
Helper I

That was easier then I expected xD

 

I used the code below to achieve this

 

Count all article below 0 = CALCULATE(SUM(Data[Quantity Ordered]), Data[SoldPrice-NP] < 0)

Helpful resources

Announcements
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.

June 2025 community update carousel

Fabric Community Update - June 2025

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