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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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