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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Counting negative numbers in Power BI

Hi everyone, 

 

In Power BI data I have 3 columns named DTAT, Vendor Name, and Engine Model.

 

Is there anyway to count the number of negative values in DTAT and whether those negative numbers are specific to a vendor or an engine model in the Vendor Name & Engine Model columns?

 

Ex: 324 negative values in Vendor A; 120 negative values in Vendor B   OR  122 negative values in Engine A, etc.

 

[The 3 columns all have relationships with each other]

 

Thank you so much! Any help or suggestion is very much appreciated!

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

One sample for your reference.

 

Measure = CALCULATE(COUNT(Table1[DTAT]),Table1[DTAT]<0)

 

Capture.PNG

 

Regards,

Frank

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

One sample for your reference.

 

Measure = CALCULATE(COUNT(Table1[DTAT]),Table1[DTAT]<0)

 

Capture.PNG

 

Regards,

Frank

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
dedelman_clng
Community Champion
Community Champion

Your general approach would be to use a FILTER condition.  Tying the counts to a specific vendor or engine is best done probably using visual filters on a card or table.

 

NegCount  = CALCULATE( COUNT(Table[DTAT]), Table[DTAT] < 0 )

or

NegCount  = CALCULATE( COUNT(Table[DTAT]), 
    FILTER(Table, Table[DTAT] < 0 ) )

Hope this helps

David

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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