Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi All,
I am trying to create calculation of a value I get with the measure:
GAL =
VAR Total_Hours =
SUMX(
'GAL',
HOUR('GAL'[TotalTime]) + DIVIDE(MINUTE('GAL'[TotalTime]),60) + DIVIDE(SECOND('GAL'[TotalTime]),3600)
)
VAR DaysTotal = DIVIDE(Total_Hours,24)
VAR HoursTotal = (DaysTotal)*24
VAR HoursInt = TRUNC(HoursTotal)
VAR MinutesTotal = (HoursTotal - HoursInt)*60
VAR MinutesInt = TRUNC(MinutesTotal)
VAR SecondsTotal = ROUND((MinutesTotal - MinutesInt)*60,0)
RETURN
FORMAT(HoursInt,"00")&"h, "&FORMAT(MinutesInt,"00")&"m, "&FORMAT(SecondsTotal,"00")&"s "
With this measure will present me the amount of hours calculate from the column 'TotalTime'. It will be presented like this:
87h, 22m, 22s
I would like to take the 'hours' and calculate how much percentage it will be out of 192 for example.
I have tried to use this:
Percentage = DIVIDE(ExistingMeasureValue, TotalMeasureValue, 0) * 100
But i get an error it can't use the hours value to calculate.
Any other suggestion ?
Solved! Go to Solution.
your GAL measure has a variable for hours:
Total_Hours
if you created a new measure that filled that variable the same way and another variable that had your total_value (192) then you could just return
divide(total_hours, total_value) and format the measure as a percentage
please show the actual measure or variable names you are using to calculate
Percentage = DIVIDE(ExistingMeasureValue, TotalMeasureValue, 0) * 100
I use this to get the total amount of hours from Excel file:
GAL = VAR Total_Hours = SUMX( 'GAL', HOUR('GAL'[TotalTime]) + DIVIDE(MINUTE('GAL'[TotalTime]),60) + DIVIDE(SECOND('GAL'[TotalTime]),3600) ) VAR DaysTotal = DIVIDE(Total_Hours,24) VAR HoursTotal = (DaysTotal)*24 VAR HoursInt = TRUNC(HoursTotal) VAR MinutesTotal = (HoursTotal - HoursInt)*60 VAR MinutesInt = TRUNC(MinutesTotal) VAR SecondsTotal = ROUND((MinutesTotal - MinutesInt)*60,0) RETURN FORMAT(HoursInt,"00")&"h, "&FORMAT(MinutesInt,"00")&"m, "&FORMAT(SecondsTotal,"00")&"s "
no, I wanted to see the values or measures you wanted to plug into
Percentage = DIVIDE(ExistingMeasureValue, TotalMeasureValue, 0) * 100 based on your GAL measure
The vaules from the TotalTime colmun, are calculated by the measure above.
Its the only measure i have, I thought to use this measure, and do the calculation from the value i get from it.
Could be i am not in the right direction at all, i am very new to Power BI.
Thanks
your GAL measure has a variable for hours:
Total_Hours
if you created a new measure that filled that variable the same way and another variable that had your total_value (192) then you could just return
divide(total_hours, total_value) and format the measure as a percentage
Thanks so much
User | Count |
---|---|
98 | |
90 | |
82 | |
73 | |
67 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
66 |