Forum Discussion
Valentb
Advocate I
2 years agoCompare same campaign - Different dates in Previous Year Using DAX
Hi Guys, I'm trying to solve a puzzle. I have a date_dim that contain dates and campaign name. Since the campaigns both can have variable dates but needs to be the same 'campaign name -1 year...
- 2 years ago
Edited: Got it working. added Convert ((...), String)
So far have the following code, but it's not working when i insert -1 it no longer works.
Tried adding "Value" - doesn't help
I'm close - also it's direct query in dual mode so no calculated column is allowedVar last_campaign = (LEFT(SELECTEDVALUE(Date[Campagin_Name]),3)&" "& Value(RIGHT(SELECTEDVALUE(Date[Campagin_Name]),4)-1)) return CALCULATE([Sales], REMOVEFILTERS(Date), Filter(Date,Values(Date[Campagin_Name])=last_campaign))