Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
IrisD
New Member

Compare timeseries with different start dates

Hi folks, 

 

I want to compare how different campaigns are progressing based on number of days into the campaign rather than by date (see day1, day2, etc... on the x-axis below).

 

IrisD_0-1639962830311.png

 

Here is my DAX code, but I can't get it to work. Any help would be much appreciated...

Normalised Campaign Metrics =

VAR DateReached = CALCULATE(MIN(Days[Day]),db[PAYMENT_DATE]<> BLANK(), KEEPFILTERS(db[PRODUCT_CODE SWITCH]))

VAR MaxDate = CALCULATE(MAX(db[PAYMENT_DATE]),KEEPFILTERS(db[PRODUCT_CODE SWITCH]))

VAR DayNo = SELECTEDVALUE(Days[Day])

RETURN CALCULATE(count(db[PAYMENT_DATE]),
FILTER(ALL(db[PAYMENT_DATE]),
DateReached+DayNo && DateReached+DayNo<=MaxDate))

 

9 REPLIES 9
adelinadamian
Frequent Visitor

hi, can you share the solution with everyone, please? I'm trying to do something similar

Anonymous
Not applicable

Hi @IrisD @nda_racgp ,

 

Do you have the [start date] column in the table? If so you could create a calculated column by using DATEDIFF() function to get the date diffenence between [start date] and [PAYMENT_DATE].

days = datediff([start date],[PAYMENT_DATE],days)

Then use this column in your formula and as x-axis in the visual.

 

Best Regards,

Jay

Hey Jay,

 

Thanks, we tried this and the axis displays the days, however, it doesn't seem to want to work with a cumulative measure 😞 

Anonymous
Not applicable

Hi @nda_racgp ,

 

You will need to modify the formula to calculate the cumulative value based on the days. Share some fake data so that I might be able to help writing formula.

 

Best Regards,

Jay

Hi @Anonymous ,

Thanks for your help! Here's some sample data:
Days Since LaunchPRODUCT_CODE SWITCHCampaign Launch DatePAYMENT_DATECount of PAYMENT_DATE
0Current Campaign10/11/2021 0:0010/11/2021 0:001
0Mar-2104/03/2021 0:0004/03/2021 0:002
5Mar-2104/03/2021 0:0009/03/2021 0:004
6Mar-2104/03/2021 0:0010/03/2021 0:00127
7Mar-2104/03/2021 0:0011/03/2021 0:00142
8Mar-2104/03/2021 0:0012/03/2021 0:0077
9Mar-2104/03/2021 0:0013/03/2021 0:0031
10Mar-2104/03/2021 0:0014/03/2021 0:0032
11Mar-2104/03/2021 0:0015/03/2021 0:00115
12Mar-2104/03/2021 0:0016/03/2021 0:0056
13Mar-2104/03/2021 0:0017/03/2021 0:0044
14Current Campaign10/11/2021 0:0024/11/2021 0:001
14Mar-2104/03/2021 0:0018/03/2021 0:0048
15Current Campaign10/11/2021 0:0025/11/2021 0:0036
15Mar-2104/03/2021 0:0019/03/2021 0:0025
16Current Campaign10/11/2021 0:0026/11/2021 0:0047
16Mar-2104/03/2021 0:0020/03/2021 0:0013
17Current Campaign10/11/2021 0:0027/11/2021 0:008
17Mar-2104/03/2021 0:0021/03/2021 0:0022
18Mar-2104/03/2021 0:0022/03/2021 0:0073
19Current Campaign10/11/2021 0:0029/11/2021 0:0043
19Mar-2104/03/2021 0:0023/03/2021 0:0043
20Current Campaign10/11/2021 0:0030/11/2021 0:0016
20Mar-2104/03/2021 0:0024/03/2021 0:0045
21Current Campaign10/11/2021 0:0001/12/2021 0:0017
21Mar-2104/03/2021 0:0025/03/2021 0:0059
22Current Campaign10/11/2021 0:0002/12/2021 0:0013
22Mar-2104/03/2021 0:0026/03/2021 0:0050
23Current Campaign10/11/2021 0:0003/12/2021 0:009
23Mar-2104/03/2021 0:0027/03/2021 0:0020
24Current Campaign10/11/2021 0:0004/12/2021 0:001
24Mar-2104/03/2021 0:0028/03/2021 0:0025
25Current Campaign10/11/2021 0:0005/12/2021 0:001
25Mar-2104/03/2021 0:0029/03/2021 0:0099
26Current Campaign10/11/2021 0:0006/12/2021 0:0024
26Mar-2104/03/2021 0:0030/03/2021 0:00205
27Current Campaign10/11/2021 0:0007/12/2021 0:008
27Mar-2104/03/2021 0:0031/03/2021 0:00225
28Current Campaign10/11/2021 0:0008/12/2021 0:0015
28Mar-2104/03/2021 0:0001/04/2021 0:0082
29Current Campaign10/11/2021 0:0009/12/2021 0:0010
29Mar-2104/03/2021 0:0002/04/2021 0:0023
30Current Campaign10/11/2021 0:0010/12/2021 0:0010
30Mar-2104/03/2021 0:0003/04/2021 0:0011
31Current Campaign10/11/2021 0:0011/12/2021 0:002
31Mar-2104/03/2021 0:0004/04/2021 0:0010
 
Thank you!
amitchandak
Super User
Super User

@IrisD ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hey @amitchandak , thanks for getting back to us! I work with @IrisD - are you able to access this link? I'll message you the password.

 

Campaign performance PBI 

@nda_racgp , Not able to access the file. I tried password you shared

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak , don't think our O365 allows us to share links externally. I've just direct messaged you.

 

Thanks again!

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.