Forum Discussion
Calculated Column to Measure
- 1 year ago
Hello AllanBerces
To make the formula work when the [used_Area] column is in context, you can use the following DAX instead:
Overall_Cum_PT_YTD_Measure = VAR CurrentDate = SELECTEDVALUE ( TRS[WeekNo:] ) VAR Filteredtable = FILTER ( ALL ( 'TRS' ), TRS[WeekNo:] <= CurrentDate && TRS[Type] <> "Non-productive" ) RETURN IF ( ISINSCOPE ( TRS[used_AREA] ), CALCULATE ( SUM ( 'TRS'[NPTHrs] ), Filteredtable, VALUES ( TRS[used_AREA] ) ), CALCULATE ( SUM ( 'TRS'[NPTHrs] ), Filteredtable ) )I am attaching the Power BI with modified formula in the attachment.
Best Regards,
Udit
If this post helps, then please consider Accepting it as the solution to help other members find it more quickly.
Appreciate your Kudo 👍
🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
✨ Visit My Linktree: LinkTree
Proud to be a Super User
Hi quantumudit thank yu very much for the reply, but when i put table show same value for used_AREA, possible to segregate by used_AREA
Thank you
Hello AllanBerces
To make the formula work when the [used_Area] column is in context, you can use the following DAX instead:
Overall_Cum_PT_YTD_Measure =
VAR CurrentDate =
SELECTEDVALUE ( TRS[WeekNo:] )
VAR Filteredtable =
FILTER (
ALL ( 'TRS' ),
TRS[WeekNo:] <= CurrentDate
&& TRS[Type] <> "Non-productive"
)
RETURN
IF (
ISINSCOPE ( TRS[used_AREA] ),
CALCULATE (
SUM ( 'TRS'[NPTHrs] ),
Filteredtable,
VALUES ( TRS[used_AREA] )
),
CALCULATE (
SUM ( 'TRS'[NPTHrs] ),
Filteredtable
)
)
I am attaching the Power BI with modified formula in the attachment.
Best Regards,
Udit
If this post helps, then please consider Accepting it as the solution to help other members find it more quickly.
Appreciate your Kudo 👍
🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
✨ Visit My Linktree: LinkTree
Proud to be a Super User
- AllanBerces1 year agoPost Prodigy
Hi quantumudit thank you very much working perfectly
- quantumudit1 year agoSuper User