Forum Discussion
measure help
- 5 years ago
Measure = VAR __Min = DATE(YEAR(TODAY()),MONTH(TODAY()),1) VAR __Max = EOMONTH(__Min,0) RETURN SWITCH(TRUE(), MAX([Date])<__Min,"Previous Month", MAX([Date])>__Max,"Next Month", "Actual Month" )But you can't use a measure in a slicer unless you use the disconnected table trick. In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick/ba-p/279563
Measure =
VAR __Min = DATE(YEAR(TODAY()),MONTH(TODAY()),1)
VAR __Max = EOMONTH(__Min,0)
RETURN
SWITCH(TRUE(),
MAX([Date])<__Min,"Previous Month",
MAX([Date])>__Max,"Next Month",
"Actual Month"
)
But you can't use a measure in a slicer unless you use the disconnected table trick. In general, to use a measure in that way, you need to use the Disconnected Table Trick as this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick/ba-p/279563
thank you very much Greg_Deckler
it is working
following you from tweeter too 🙂
i wish you success in your business always!you are very helpful