Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Please see image below. The last three columns on the right are measures that provide averages by our production day of week based on production date range selected in relative slicer. The figures that display here are correct. Now I simply want to use those measures in a new column based on the WeekdayNum - something like this - no aggregates needed:
AvgbyDOW = IF(CPwithFuturePullDate[WeekdayNum]=2,[AvgCrtnsTu],IF(CPwithFuturePullDate[WeekdayNum]=4,[AvgCrtnsTh],[AvgCrtnsSat])
How might this be accomplished?
It seems like it should be simple but I can't seem to find a solution that works. Thanks for your help!
Solved! Go to Solution.
HI @merryseeker
Try this MEASURE
AvgbyDOW = VAR myweek = SELECTEDVALUE ( CPwithFuturePullDate[WeekdayNum] ) RETURN SWITCH ( TRUE (), myweek = 2, [AvgCrtnsTu], myweek = 4, [AvgCrtnsTh], [AvgCrtnsSat] )
When you say new column, you mean new measure correct? The issue I foresee depending on how your measures are calculated is that if you put them into a new calculated column in your table then they are going to be constrained by that row context and I'm thinking perhaps not give you what you are expecting.
HI @merryseeker
Try this MEASURE
AvgbyDOW = VAR myweek = SELECTEDVALUE ( CPwithFuturePullDate[WeekdayNum] ) RETURN SWITCH ( TRUE (), myweek = 2, [AvgCrtnsTu], myweek = 4, [AvgCrtnsTh], [AvgCrtnsSat] )
Thanks so much Zubair_Muhammad! This worked after I deactivated a relationship that I apparently did not need to have active.