Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi dear community.
I've been trying for hours, but I cannot seem to get the right results. I've had different results but my last attempt is in the screenshot.
What i need to do is calculate a percentage based on hours.
SICK HOURS / TOTAL HOURS * 100
The expected results are in the notepad below.
I cannot attach the report because of privacy unfortunately.
Column Tijdsregistraties["Dagen"] is a custom column with the following: Dagen = Tijdsregistraties[duur] / 60 / 60 / 1000 / 8
The sick hours is based on a column ProductRegistratie which contains the text "Ziek" it uses the same Dagen column but with this filter on it.
My attempt is:
DagenZiektePercentagee =
var ziektedagen = CALCULATE(SUM(Tijdsregistraties[Dagen]);Tijdsregistraties[ProductRegistratie] = "Ziek")
var dagentotaal = SUM(Tijdsregistraties[Dagen])
return
ziektedagen / dagentotaal
Solved! Go to Solution.
Well maybe im stupid or need to learn more about PowerBI.
Using a column with this DAX command was giving strange results.
After using a measure, it works perfectly...
Why does this matter so much...?
Anyway : this worked as a charm in a measure:
Dagentest = SUM(Tijdsregistraties[Dagen Ziek]) / SUM(Tijdsregistraties[Dagen Gewerkt]) * 100
Can you just click the little drop down arrow in the Fields area for your column and click Show as | Percent of Total?
Hi
Thanks for the suggestion, i tried that and that does not give me the expected results. The results should be seperately calculated from eachother per individual exactly like i showed in the notepad.
I need to calculate per individual:
DIVIDE: SICK DAYS BY TOTAL WORK DAYS TIMES 100
Well maybe im stupid or need to learn more about PowerBI.
Using a column with this DAX command was giving strange results.
After using a measure, it works perfectly...
Why does this matter so much...?
Anyway : this worked as a charm in a measure:
Dagentest = SUM(Tijdsregistraties[Dagen Ziek]) / SUM(Tijdsregistraties[Dagen Gewerkt]) * 100
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |