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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
SUMESHKUMAR22
Helper IV
Helper IV

Calculate reference average line using DAX

Hi Team,

Urgent help!

Problem: Want to calculate the average reference line using DAX instead of using the line chart option.
PBIX File 
This average reference line should be dynamic to whatever time slicer we select in the above range. E.g.: for last 7 days its coming as Avg- 3 but how to calcuate this using DAX??

SUMESHKUMAR22_1-1743304485826.png

Thanks in advance!

1 ACCEPTED SOLUTION

Hi @SUMESHKUMAR22 

 

Would a measure like this help?

_My Avg = 
AVERAGEX(
    ADDCOLUMNS(
        SUMMARIZE(
            ALL( 'Sample' ),
            'DIM Date'[Date],
            'Dim_Channels'[Channel]
        ),
        "__Value", [current base sum cal]
    ),
    [__Value]
)

 

Let me know if you have any questions.



Proud to be a Super User!

daxformatter.com makes life EASIER!

View solution in original post

2 REPLIES 2
SUMESHKUMAR22
Helper IV
Helper IV

Hi Team,

Replaced the new pbix file within the above link. Please refer the Dax average line & in built average line . Let me know which is calculating the correct average?

Thanks!

Hi @SUMESHKUMAR22 

 

Would a measure like this help?

_My Avg = 
AVERAGEX(
    ADDCOLUMNS(
        SUMMARIZE(
            ALL( 'Sample' ),
            'DIM Date'[Date],
            'Dim_Channels'[Channel]
        ),
        "__Value", [current base sum cal]
    ),
    [__Value]
)

 

Let me know if you have any questions.



Proud to be a Super User!

daxformatter.com makes life EASIER!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.