Forum Discussion
Create relationship between measures and column from another table
- 7 years ago
Hi DJOXXXA
You can create another Measure for previous week, year icon using same logic as you did to return the description or use something like below.
PrevIcon = VAR _prev = { [PrevDesc] } RETURN CALCULATE( SELECTEDVALUE( icons[Icon] ), ALL( icons ), TREATAS( _prev, icons[Desc] ) )This measure will use the result of your current measures and find the corresponding icons, like below.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
Hi Mariusz,
Due to the requirement to compare Monday from this week with Monday from the last week or with Monday from the same week last year, I have introduced additional helper columns in my calendar, in order to calculate these values as easily as possible.
So, measure for the Weather last week looks like this:
Weather Last Week = CALCULATE(VALUES(Weather[Weather]);
FILTER(ALL('Calendar');'Calendar'[LW Helper Column] = MAX('Calendar'[LW Helper Column]) -1) )and the LW Helper Column is a nothing more than a calculated column:
LW Helper Column = Weekday * 1000000 + Cumulative Week
I know this is not "by the book" solution, but I havent found any other way to match weeks on weekday basis. Almost same measure formula is used for Last year calculation, but with different helper column (just replace LW Helper with LY Helper):
LY Helper Column = Weekday * 1000000 + Week * 10000 + Year
Hi DJOXXXA
You can create another Measure for previous week, year icon using same logic as you did to return the description or use something like below.
PrevIcon =
VAR _prev = { [PrevDesc] }
RETURN
CALCULATE(
SELECTEDVALUE( icons[Icon] ),
ALL( icons ),
TREATAS( _prev, icons[Desc] )
)This measure will use the result of your current measures and find the corresponding icons, like below.
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
