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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
kay87
Frequent Visitor

Reference Line Question

Hi All

 

I am an advanced Qlik user and looking to find a way to add a reference line to a trend chart in Power BI.

 

I have a calculated measure ie KPI_5_BaseLineMean which returns one value depending on date selections. I would like to add this measure as a reference line to the line chart. Please see the example screenshots below.

 

 

1.PNG2.PNG

 

Regards

Kay

2 ACCEPTED SOLUTIONS
MFelix
Super User
Super User

Hi @kay87,

 

I have made a mockup of a file using only dates + value and calculating the moving average:

  • Create a date table
  • Make a non-active relationship between both table based on date
  • Create the following measure:
  • BASE_LINE = 
    CALCULATE (
        AVERAGEX (
            SUMMARIZE (
                ALL ( 'Fact Table'[Date]; 'Fact Table'[Values] );
                'Fact Table'[Date];
                "AVERAGE VALUES"; AVERAGE ( 'Fact Table'[Values] )
            );
            [AVERAGE VALUES]
        );
        'Fact Table'[Date] = VALUES ( 'Fact Table'[Date] );
        USERELATIONSHIP ( DimDate[Date]; 'Fact Table'[Date] )
    )
    Be aware that I'm using AVERAGEX but based on your context you may have to use another type of aggregator.
  • Create a slicer with the Date table date
  • Add the measure to your line chart along side with the values.

As you can see the average is moving with the changes of the slicer.

 

moving_average.gif

 

Not sure if this is waht you need.

 

Regards,

Mfelix

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português





View solution in original post

kay87
Frequent Visitor

Thank you soo very much for this MFelix. This is very close to what I want to do. My average formula is very different but this is massively helpful and point sme in a direction. 

 

Is there a chance you could share the bix file for my reference?

 

Regards

Kay

View solution in original post

4 REPLIES 4
MFelix
Super User
Super User

Hi @kay87,

 

I have made a mockup of a file using only dates + value and calculating the moving average:

  • Create a date table
  • Make a non-active relationship between both table based on date
  • Create the following measure:
  • BASE_LINE = 
    CALCULATE (
        AVERAGEX (
            SUMMARIZE (
                ALL ( 'Fact Table'[Date]; 'Fact Table'[Values] );
                'Fact Table'[Date];
                "AVERAGE VALUES"; AVERAGE ( 'Fact Table'[Values] )
            );
            [AVERAGE VALUES]
        );
        'Fact Table'[Date] = VALUES ( 'Fact Table'[Date] );
        USERELATIONSHIP ( DimDate[Date]; 'Fact Table'[Date] )
    )
    Be aware that I'm using AVERAGEX but based on your context you may have to use another type of aggregator.
  • Create a slicer with the Date table date
  • Add the measure to your line chart along side with the values.

As you can see the average is moving with the changes of the slicer.

 

moving_average.gif

 

Not sure if this is waht you need.

 

Regards,

Mfelix

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português





kay87
Frequent Visitor

Thank you soo very much for this MFelix. This is very close to what I want to do. My average formula is very different but this is massively helpful and point sme in a direction. 

 

Is there a chance you could share the bix file for my reference?

 

Regards

Kay

Hi @kay87,

 

See attach the PBIX file.

 

Be aware it's a we transfer link so will only last 7 days.

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português





Greg_Deckler
Community Champion
Community Champion

Didn't get the screen shots. You could potentially do this via something like a clustered column and line chart visual.

 

OK, now I see the screen shots. Weird. Well, currently you cannot use columns or measures in Analytics pane constant lines to the best of my knowledge.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.