Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I want to count all negative numbers by rows and in total...but it doesn't work in total
Solved! Go to Solution.
@Nick_2510
Please try
Count of -ve =
SUMX (
CROSSJOIN ( VALUES ( 'Date'[Date] ), VALUES ( Data[Name] ) ),
IF ( [diff_AvSal_bal] < -1, 1, 0 )
)
@Nick_2510
Please try
Count of -ve =
SUMX (
CROSSJOIN ( VALUES ( 'Date'[Date] ), VALUES ( Data[Name] ) ),
IF ( [diff_AvSal_bal] < -1, 1, 0 )
)
Thx a lot! It works!
But now I need to add one option in IF constraction...
switch off name if name in a period - data for this in another table with colomns (Name, Start_period, End_Period)
Count of -ve =
@Nick_2510
Now its different. I need to see sample data of the two tables and the relationships between the three tables.
delist
data
relationships
other 2 tables are handbooks....Glossary - names of products and specifications, and Celendar(Date)
@Nick_2510
In your table visual please use the [Name] column from the 'delist' dimention table and not from the fact 'Data' table. Then you may try
Count of -ve =
SUMX (
CROSSJOIN ( VALUES ( 'Календарь'[Date] ), delist ),
IF (
[diff_AvSal_bal] > 0
|| 'Календарь'[Date] IN CALENDAR ( delist[Start_per], delist[End_per] ),
0,
1
)
)
But in table 'delist' are not all names...the main table is Data...all calculations and visualizations are made due to it...and Name I take from Glossary...
Can you share a sample file?
@Nick_2510
Sorry I was confused and replied to your other post
https://community.powerbi.com/t5/DAX-Commands-and-Tips/IF-Conditions/m-p/2512570#M69732
HI @tamerj1
It should be 0, because this names on this dates are in delist table (second condition)....(((
@tamerj1
No, I mean put 0 if name on this day is in delist OR diff_AvSal_bal > 0...but it takes 1...I tried to reverse conditions and got error
try this,
Negative val = SUMX(Negative,IF(Negative[Diff]<0,1,0))
This formula is not for measures
Hi @Nick_2510
Please try
Count of -ve =
SUMX ( VALUES ( Data[Name] ), CALCULATE ( IF ( [diff_AvSal_bal] < -1, 1, 0 ) ) )
Hi! The same result(
@Nick_2510
Do you have other active filters of the page or on the visual? any slicers? Any other table or other column invloved?
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 7 | |
| 6 |