Join 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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I have two columns PAR_Hours which are numeric values and PAR_Codes which are text values. I need to sum all hours for specific codes (LN, LD and DR)
I tried using several versions of this formula to no avail, results are always blank.
Solved! Go to Solution.
Hi,
Try this measure
=CALCULATE(SUM(Absenteeism[PAR_HOURS]),Absenteeism[PAR_CODE]="LN"||Absenteeism[PAR_CODE]="LD"||Absenteeism[PAR_CODE]="DR")
Hope this helps.
Hi,
Try this measure
=CALCULATE(SUM(Absenteeism[PAR_HOURS]),Absenteeism[PAR_CODE]="LN"||Absenteeism[PAR_CODE]="LD"||Absenteeism[PAR_CODE]="DR")
Hope this helps.
Thank you, it worked!
You are welcome.
Hi @lc1 ,
Try this measure:
Measure=
CALCULATE(
SUM(Absenteeism[PAR_HOURS]),
FILTER(
Absenteeism,
Absenteeism[PAR_CODE] in {"LN", "LD", "DR"}
)
)
OR
Measure1=
CALCULATE(
SUM(Absenteeism[PAR_HOURS]),
FILTER(
ALL(Absenteeism),
Absenteeism[PAR_CODE] in {"LN", "LD", "DR"}
)
)
"MdxScript (Model 8, 37)...A table of multiple values was supplied where a single value was expected."
VALUES(Absenteeism[PAR_HOURS]) will return a single column table, however, you what you created is a measure, so the program reports an error.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Try
CALCULATETABLE(VALUES(Absenteeism[PAR_HOURS]),filter(Absenteeism,Absenteeism[PAR_CODE] in {"LN","LD","DR"}))
OR
CALCULATETABLE(VALUES(Absenteeism[PAR_HOURS]),filter(all(Absenteeism),Absenteeism[PAR_CODE] in {"LN","LD","DR"}))
It didn't work, got an error:
MdxScript (Model 8, 37)...A table of multiple values was supplied where a single value was expected.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |