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.
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 |
|---|---|
| 78 | |
| 48 | |
| 35 | |
| 31 | |
| 27 |