Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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'
I cannot use sameperiod last year, but maybe date add and some variable?
I'm just really stuck and have no clue how to solve this.
Thanks alot for any help
Solved! Go to Solution.
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 allowed
Var 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))
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 allowed
Var 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))
For your reference.
I added 'Campaign_Name-1' column in the table.
You can select 2 campaigns with 2 slicers.
Try using DateADD, just attempt and if you have challenge paste the current result with expected result
Proud to be a Super User!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
75 | |
43 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |