Forum Discussion
Help with SELECTEDVALUE measure please
- 4 years ago
Hi, MWare
You can try the following methods.
Maesure:
Measure 2 = Var p=CALCULATE(max(Date_Period_Table[Period]),ALL(Date_Period_Table),Date_Period_Table[Date]=SELECTEDVALUE('Date'[Date])) return IF(SELECTEDVALUE(Date_Period_Table[Period])=p && SELECTEDVALUE(Date_Period_Table[Date])=SELECTEDVALUE('Date'[Date]),"Day Selected", IF(SELECTEDVALUE(Date_Period_Table[Period])=p && SELECTEDVALUE(Date_Period_Table[Date])<=SELECTEDVALUE('Date'[Date]),"PTD" ))Measure 3 = IF([Measure 2]=SELECTEDVALUE('Reporting View'[Reporting View]),1,0)At this point the result can be run in a view.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, MWare
You can try the following methods.
Measure:
Measure Day Selected =
Var p=CALCULATE(max(Date_Period_Table[Period]),ALL(Date_Period_Table),Date_Period_Table[Date]=SELECTEDVALUE('Date'[Date]))
return
IF(SELECTEDVALUE(Date_Period_Table[Period])=p && SELECTEDVALUE(Date_Period_Table[Date])=SELECTEDVALUE('Date'[Date]),"Day Selected")Measure PTD =
Var p=CALCULATE(max(Date_Period_Table[Period]),ALL(Date_Period_Table),Date_Period_Table[Date]=SELECTEDVALUE('Date'[Date]))
return
IF(SELECTEDVALUE(Date_Period_Table[Period])=p && SELECTEDVALUE(Date_Period_Table[Date])<=SELECTEDVALUE('Date'[Date]),"PTD"
)
Measure 3 =
IF([Measure Day Selected]=SELECTEDVALUE('Reporting View'[Reporting View]),1,
IF([Measure PTD]=SELECTEDVALUE('Reporting View'[Reporting View]),1,0))
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-zhangti Hi, did you need to do anything to the formating of the measures or anything else as I've tried to recreate this a number of times in new reports and each time the Day Selected will work and just show day selected in Date filter however when I select PTD it will only return the value that's selected in the Date filter. Obviously in the file that you worked on, the measures and concept all works perfectly, but as I say when I try to replicate this in a new report from scratch I get the issue with the PTD only returning the date in the Date filter and not all the dates prior to the Date filter that are included within the Period.