Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello!
I've tried looking around and I just can't find why it's not showing the Total Value in the "Total Row"
Code:
Hi @thisguyjc ,
Based on the description, try using ISINSCOPE function.
Lön =
VAR NormalTimmar = SELECTEDVALUE(Dim_Lon[NormalarbetstidMånad])
VAR FastLon = SELECTEDVALUE(Dim_Lon[Fast Lön])
VAR Overtid = SELECTEDVALUE(Dim_Lon[Övertidsersättning/h])
VAR Timlon = SELECTEDVALUE(Dim_Lon[TimlönAlla])
VAR Semesterersattning = SELECTEDVALUE(Dim_Lon[Semestererättningtimanställda(%)]) / 100
VAR Anstallningstyp = SELECTEDVALUE(Dim_Lon[Anställningstyp])
RETURN
IF(
ISINSCOPE(Dim_Lon[Anställningstyp]),
SUMX(
VALUES(Dim_Date[Date]),
VAR ArbetadeTimmar = CALCULATE(SUM(Fact_Tidsrapport[Timmar]), Dim_Date[Date] = EARLIER(Dim_Date[Date]))
RETURN
SWITCH(
TRUE(),
AND(Anstallningstyp = "Heltid", ArbetadeTimmar > NormalTimmar),
FastLon + ((ArbetadeTimmar - NormalTimmar) * Overtid),
AND(Anstallningstyp = "Heltid", ArbetadeTimmar = NormalTimmar),
FastLon,
AND(Anstallningstyp = "Deltid", ArbetadeTimmar > NormalTimmar),
FastLon + ((ArbetadeTimmar - NormalTimmar) * Overtid),
AND(Anstallningstyp = "Deltid", ArbetadeTimmar = NormalTimmar),
FastLon,
Anstallningstyp = "Timanställd",
(Timlon * ArbetadeTimmar) + (Timlon * ArbetadeTimmar * Semesterersattning),
Timlon * ArbetadeTimmar
)
)
)
ISINSCOPE function (DAX) - DAX | Microsoft Learn
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @v-jiewu-msft !
Unfortunately all the Data just turned blank in the table with the inscope function.
@thisguyjc First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8
Hi @thisguyjc
Try with this measure
Lön =
VAR NormalTimmar = MAX(Dim_Lon[NormalarbetstidMånad])
VAR FastLon = MAX(Dim_Lon[Fast Lön])
VAR Overtid = MAX(Dim_Lon[Övertidsersättning/h])
VAR Timlon = MAX(Dim_Lon[TimlönAlla])
VAR Semesterersattning = MAX(Dim_Lon[Semestererättningtimanställda(%)]) / 100
VAR Anstallningstyp = MAX(Dim_Lon[Anställningstyp])
RETURN
SUMX(VALUES(Dim_Date[Date]),
VAR ArbetadeTimmar = CALCULATE(SUM(Fact_Tidsrapport[Timmar]), Dim_Date[Date] = EARLIER(Dim_Date[Date]))
RETURN
SWITCH(TRUE(),
AND(Anstallningstyp = "Heltid", ArbetadeTimmar > NormalTimmar),
FastLon + ((ArbetadeTimmar - NormalTimmar) * Overtid),
AND(Anstallningstyp = "Heltid", ArbetadeTimmar = NormalTimmar),
FastLon,
AND(Anstallningstyp = "Deltid", ArbetadeTimmar > NormalTimmar),
FastLon + ((ArbetadeTimmar - NormalTimmar) * Overtid),
AND(Anstallningstyp = "Deltid", ArbetadeTimmar = NormalTimmar),
FastLon,
Anstallningstyp = "Timanställd",
(Timlon * ArbetadeTimmar) + (Timlon * ArbetadeTimmar * Semesterersattning),
Timlon * ArbetadeTimmar)
)
Let me know if it works
Ummh wait actually, I counted the total and it should be around 6,389,299 but it became "11,817,750"
So it kinda almost doubled on the total 😮
Hello @suparnababu8!
Thank you very much, this helped!
What was your thought process regarding this? How did you know to changed SELECTEDVALUE into MAX?
I'm pretty new to PowerBI and DAX so it's hard for me to understand some stuff.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
81 | |
51 | |
39 | |
34 |
User | Count |
---|---|
95 | |
78 | |
52 | |
49 | |
47 |