Forum Discussion
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!
Hi Anonymous,
One sample for your reference.
Measure = CALCULATE(COUNT(Table1[DTAT]),Table1[DTAT]<0)
Regards,
Frank
2 Replies
- dedelman_clng
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
- v-frfei-msft
Community Support
Hi Anonymous,
One sample for your reference.
Measure = CALCULATE(COUNT(Table1[DTAT]),Table1[DTAT]<0)
Regards,
Frank