Forum Discussion
AllanBerces
3 months agoPost Prodigy
Calculated Column to Measure
Hi good day can anyone help me convert my calculated column into measure. I m having trouble on my report. Thank you in advance %_Daily Plan = DIVIDE('Table01'[Overall_Cum_Plan_Hrs],'Table01'[Ove...
Balqis_Adan
3 months agoFrequent Visitor
the main challenge here is replacing the EARLIER function with Variables (VAR) to capture the current context of the row. Also, ensure you use MAX or SELECTEDVALUE to identify the current Date, Complex, and Mode within your Measure. This will make your report much faster than using Calculated Columns
Cumulative Plan Hrs
Overall_Cum_Plan_Hrs_Measure =
VAR CurrentDate = MAX('Table 01'[PlanDate])
VAR CurrentComplex = SELECTEDVALUE('Table 01'[Complex])
VAR CurrentMode = SELECTEDVALUE('Table 01'[Mode])
RETURN
CALCULATE(
SUM('Table 01'[Plan Hrs]),
FILTER(
ALL('Table 01'),
'Table 01'[Complex] = CurrentComplex &&
'Table 01'[Mode] = CurrentMode &&
'Table 01'[PlanDate] <= CurrentDate
)
)
Overall Total
Overall_Total_Measure =
VAR CurrentComplex = SELECTEDVALUE('Table 01'[Complex])
VAR CurrentMode = SELECTEDVALUE('Table 01'[Mode])
RETURN
CALCULATE (
SUM('Table 01'[Plan Hrs]),
FILTER (
ALL ( 'Table 01' ),
'Table 01'[Complex] = CurrentComplex &&
'Table 01'[Mode] = CurrentMode
)
)
%_Daily Plan
%_Daily Plan_Measure =
DIVIDE(
[Overall_Cum_Plan_Hrs_Measure],
[Overall_Total_Measure],
0
)
AllanBerces
2 months agoPost Prodigy
Hi Balqis_Adan krishnakanth240 v-prasare thank you very much for the reply, but have some concern it work on the Table but when i change to Matrix it not show the Total in collaps and expand
possible to make something like this
Thank you