Forum Discussion
GiorgosPap311
2 years agoRegular Visitor
Different Values Depending On Date Hierarchy
I have a very easy (I suppose) question, but it's driving me crazy. We have a table named "Dates" with 1 single column named "Date", let's say this one Dates = CALENDAR("2020-01-01", "2024-01-01")...
- 2 years ago
Hi GiorgosPap311 ,
You can refer to below measure.
Measure = SWITCH(TRUE(), ISINSCOPE('Date'[Date]), 4 , ISINSCOPE('Date'[Month]), 3 , ISINSCOPE('Date'[Quarter]), 2 , ISINSCOPE('Date'[Year]), 1 )Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
xifeng_L
Super User
2 years agoHi GiorgosPap311 ,
You can refer to below measure.
Measure =
SWITCH(TRUE(),
ISINSCOPE('Date'[Date]), 4 ,
ISINSCOPE('Date'[Month]), 3 ,
ISINSCOPE('Date'[Quarter]), 2 ,
ISINSCOPE('Date'[Year]), 1
)
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
GiorgosPap311
2 years agoRegular Visitor
I had already tried this measure, but only had 1 single column in my Dates table with the Date Hierarchy instead of using 4 different columns. I thought it should be possible only with 1 but it seems like it doesn't work the way I thought.
This works indeed, so thank you!