Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
how to write the measure of IF function?
i succeeded just calculate column.
i wont to use a measure instead of calculate column
This calculate column work
sum_if_true2 = IF((sh[asmbly])=TRUE(),[total sale],0)
This dax doesn't work
sum_if_true = IF(VALUES(sh[asmbly])=TRUE(),[total sale],0)
Thanks
Solved! Go to Solution.
Hi @yoav20007,
You can try below formula, I use 'lastnonblank' function to get current row contents:
sum_if_true2 =
VAR _current =
LASTNONBLANK ( sh[asmbly], [asmbly] )
RETURN
IF ( _current, [total sale], 0 )
Reference link:
Regards,
Xiaoxin Sheng
Hi,
Try this
=CALCULATE(SUM(sh[sales]),FILTER(sh,sh[asmbly]=TRUE()))
Hope this helps.
Hi @yoav20007,
You can try below formula, I use 'lastnonblank' function to get current row contents:
sum_if_true2 =
VAR _current =
LASTNONBLANK ( sh[asmbly], [asmbly] )
RETURN
IF ( _current, [total sale], 0 )
Reference link:
Regards,
Xiaoxin Sheng
Thank you @Anonymous
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 82 | |
| 48 | |
| 36 | |
| 31 | |
| 29 |