Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi
I have report where i need to do a percentage from to columns, but I cant get it to work
My tables are as below, the Percentage measure is the measure I'm trying to create.
I have used various examples found on the web, but they have not worked and calculated the correct percentage.
Any suggestions?
Hours | Sick leave | Percentage measure | |
Person A | 88 | 8 | 9% |
Person B | 57 | 15 | 26% |
Solved! Go to Solution.
@Larsc , Based on what I got, a new measure
divide(Sum(Table[Sick leave]), sum(Table[Hours]))
@Larsc , Based on what I got, a new measure
divide(Sum(Table[Sick leave]), sum(Table[Hours]))
Hi @amitchandak
Thx for the very fast reply.
The measure you gave, I think I came across that previously. The measure works, but its calculating wrong.
I have a few lines. The first column is their work hours, the second their sick leave and the third on the calculated percentage from your measure.
As you can see, its a bit off in some of the calculations. 51 work hours and 20 sick leaves calculates to 38,46 but it should be 39,22.
Some of them are correct, but some are off.
@Larsc ,
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
I will see if can get a sample pbix file for you.
But, im just thinking a bit here. Wouldent the most correct calculation of the sick leave be SICKLEAVE/(HOURS+SICKLEAVE)*100 ? How would that DAX measure look like?
For now, I have a measure that sums the hours and sick leave into a value. I need to add the divide part into that dax, how would that look?
EDIT: Ok, I now have a measure looking like this:
User | Count |
---|---|
107 | |
89 | |
81 | |
76 | |
73 |
User | Count |
---|---|
112 | |
104 | |
96 | |
74 | |
66 |