Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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?
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
6 |