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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.