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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Panto
Helper I
Helper I

Different Periods in same Line Chart starting from the same point

Hi community,

 

I'm dealing with time intelligence functions and I'm facing a challenge when it comes to let the final user selecting 2 different time periods with the final result that should be visualized as a line chart having 2 lines, both starting ath the beginning of the chart.

 

The final result should be something like this:

Different periods.png

As you can see, even though the 2 periods have different lenghts (in terms of days) and starting dates, they are somehow aligned for the first 16 days, displaying the remaining 4 days just for the longer period (green).

 

That being said, I had some ideas related to parameters but I'm not sure if this is the right way to go.

 

Has anyone faced this kind of challenge?

 

I'm pretty curious because dealing with/visualizing different periods (lenght and starting day) is one of the most challenging topic I've faced working in the BI enviroment.

 

Thanks in advance.

 

 

Fabio

Follow me on Twitter:@PantoMvp
Get in contact on Linkedin: Fabio Fantoni
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Panto , you need to have a date table connected with your table and another disconnected date table. The first formula will consider period 1 which on date table. As it joined you Measure will work

 

Measure = Calculation<>....

 

The second period will come from the disconnected table Date1, we will not use this in join just move the date

new measure =
var _min = minx(allselected(Date),Date[Date])
var _min1 = minx(allselected(Date1),Date[Date])
var _diff = datediff(_min1,_min,Day) // You may have try datediff(_min,_min1,Day)

return
calculate([measure], dateadd(Date[Date],_diff,day))

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

View solution in original post

4 REPLIES 4
v-easonf-msft
Community Support
Community Support

Hi ,  @Panto 
Not very clear.Maybe I need a bit more information.

Please explain this phrase in more detail:" even though the 2 periods have different lenghts (in terms of days) and starting dates, they are somehow aligned for the first 16 days"

It seems that the four parameters do not correspond to the picture you show?

 

You may check if the following pbix helps:

pbix attached

 

Best Regards,
Community Support Team _ Eason

 

 

amitchandak
Super User
Super User

@Panto , you need to have a date table connected with your table and another disconnected date table. The first formula will consider period 1 which on date table. As it joined you Measure will work

 

Measure = Calculation<>....

 

The second period will come from the disconnected table Date1, we will not use this in join just move the date

new measure =
var _min = minx(allselected(Date),Date[Date])
var _min1 = minx(allselected(Date1),Date[Date])
var _diff = datediff(_min1,_min,Day) // You may have try datediff(_min,_min1,Day)

return
calculate([measure], dateadd(Date[Date],_diff,day))

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,

I was trying to replicate this scenario with no success. What do you plot on the Axis to have same measure charted for different periods?

Hi @amitchandak 

 

thanks for your quick feedback: that makes sense.

 

Propbably I was too focused on replicating the same logic used in another tool via parameters and didn't think about your idea which seems really what I'm looking for.

 

Have a nice day

 

Fabio

Follow me on Twitter:@PantoMvp
Get in contact on Linkedin: Fabio Fantoni

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors