Forum Discussion
NadiaLR1234
1 year agoHelper I
Measure with multiple conditions
Good day I have the following measures DT_RevenueSCG = IFERROR([TargetDayRevenueSCG],0) DailyTargetRevenueSCG = MAX(TTVBudget[DT_RevenueSCG])*Max(vw_TTV_REN[MaxDate2]) TargetDayRevenueSCG ...
- 1 year ago
I managed to get it to work without the date divide
thank you
TargetDayRevenueSCG =VAR SCG = SELECTEDVALUE(vw_TTV_REN[SalesChannelDescGroup])VAR Revenue =SWITCH(SCG,"Leisure", SUM(TTVBudget[LeisureRevenue]),"MICE/Logistics", SUM(TTVBudget[MiceRevenue]),"Transient", SUM(TTVBudget[TransientRevenue]),"Traveller Enablement", SUM(TTVBudget[TERevenue]),0)RETURNRevenue
burakkaragoz
1 year agoSuper User
Hi NadiaLR1234 ,
You’re on the right track, but to make TargetDayRevenueSCG dynamic based on SalesChannelGroup, you’ll want to use a SWITCH or IF structure inside a measure that evaluates the current context. Here’s a pattern that should work:
TargetDayRevenueSCG =
VAR DaysInMonth = MAX(DIM_DATE[NumberOfDaysInTheMonth])
RETURN
SWITCH(
SELECTEDVALUE(SalesChannelGroup),
"Leisure", SUM(TTVBudget[LeisureRevenue]) * DaysInMonth,
"MICE/Intelligence", SUM(TTVBudget[MICEResidential]) * DaysInMonth,
"Travel/Intelligence", SUM(TTVBudget[TransientRevenue]) * DaysInMonth,
BLANK()
)Make sure:
- Your SalesChannelGroup column is properly related to the budget table.
- You’re using this measure in a visual that has SalesChannelGroup in the context (like in rows or filters).
- If you're joining on MonthKey, ensure that both your budget table and date table are aligned on that key.
Let me know if you need help adjusting this to work with SUMX or if your model has more complexity.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
NadiaLR1234
1 year agoHelper I
Maybe I must do the matrix different ? left is the matrix - right is to check if values are correct as you see now all are blank ?