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
Akka
Regular Visitor

Graph with average up to a date

Hi,

 

I have a Net promoter score-table with the entries from customers. The table has two variables, date for the reply and the value for the feedback:

 

Date_rec (dd.mm.yy)NPS_Score
01.01.2410
05.01.246
01.02.2410
02.02.247
03.03.245
14.03.246
  

 

My goal is to create a graph with dates on the x-axis and the average up to a given date on the Y-axis. In other words for 01.01 the graph value should be 10. On 05.01. it would be (10+6/2)= 8. On 01.02 it should be (10+6+10)/3= 8.67.

 

I've tried creating a graph with using Date_rec on the X-axis and the following measure:

Average_NPS=
CALCULATE(
    AVERAGE(RH[NPS_Score]),
    FILTER(
        RH,
        YEAR(RH[Date_Rec] = YEAR(TODAY())
            && RH[Date_Rec] <= TODAY()
    )
))
 
This does not give me the desired results. Could anyone please help?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @Akka,

It seems like a common multiple level aggregation in Dax expression, you can try to use the following measure formula if this help with your scenario:

Average_NPS =
VAR currDate =
    MAX ( RH[Date] )
RETURN
    AVERAGEX (
        FILTER (
            SUMMARIZE ( ALLSELECTED ( RH ), [Date], "Total", SUM ( RH[NPS_Score] ) ),
            YEAR ( RH[Date_Rec] ) = YEAR ( currDate )
                && RH[Date_Rec] <= currDate
        ),
        [Total]
    )

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

HI @Akka,

It seems like a common multiple level aggregation in Dax expression, you can try to use the following measure formula if this help with your scenario:

Average_NPS =
VAR currDate =
    MAX ( RH[Date] )
RETURN
    AVERAGEX (
        FILTER (
            SUMMARIZE ( ALLSELECTED ( RH ), [Date], "Total", SUM ( RH[NPS_Score] ) ),
            YEAR ( RH[Date_Rec] ) = YEAR ( currDate )
                && RH[Date_Rec] <= currDate
        ),
        [Total]
    )

Regards,

Xiaoxin Sheng

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.

Top Solution Authors