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

The Fabric community is upgrading! Read all of the details including the timeline and what you can expect. Learn more

Reply
Anonymous
Not applicable

Line chart challenge

(Edited)
Hi,

 

I intend to create a single line chart that visualizes 2 set of values - OValue and Forecast_Value. (both in different tables)

 

The user is given an option to choose a Product ID using a slicer. Also the user chooses the Run ID from the given filter which provides PBI the anchor date > i.e. the visual will show data N days before and N after the anchor date. 

 

Using the anchor date (suppose T) to the product ID, I intend to display:

1. OValue for 3 days prior to the date T (i.e T-3 days) and

2. Forecast_Value for 10 days after the date T (i.e T+3 days)

 

Both should be on the same graph visual as follows (here I have chosen 3rd january as the anchor date - Blue line is for OValues and Orange line for Forecast_Value

 

ksr_0-1627465186693.png

 

( I tried uploading the PBIX but the portal is not supporting it) The images of the mock data are as follows
Ovalue Table

ksr_0-1627465518979.png

Forecast Value table

ksr_1-1627465572321.png

 

 

4 REPLIES 4
Anonymous
Not applicable

Thanks for the prompt response members . But the model is this:

ksr_0-1626950621281.png

Suppose Value A is Sales which is in one table and Value B is Forecasted sales in the other table.
The visual looks like this - assuming I have forecasted values for all dates.

ksr_1-1626950730708.png

Here based on the date as the slicer, I intend to visualise Sales for T-10 days and Forecasted sales for T+10 days.

Its yet to be solved.

Hi  @Anonymous ,

 

Could you pls provide a sample .pbix file for test?

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

v-kelly-msft
Community Support
Community Support

Hi  @Anonymous ,

 

First create a date table as slicer;

Then create a measure a below:

Measure = 
var _date=SELECTEDVALUE('Date table'[Date])
Return
IF(MAX('Table'[Date])>=_date&&MAX('Table'[Date])<=_date+10,SUM('Table'[Value B]),IF(MAX('Table'[Date])<_date&&MAX('Table'[Date])>=_date-10,SUM('Table'[Value A])))

And you will see:

vkellymsft_2-1626940471042.png

 

vkellymsft_1-1626940443233.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

amitchandak
Super User
Super User

@Anonymous , with help from a date table and date from date table is used on axis

 

Value_A = calculate(sum(Table[Value]), dateadd('Date'[Date],-10,day))

 

Value_B = calculate(sum(Table[Value]), dateadd('Date'[Date],10,day))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

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

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

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.