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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Puthenveedu
Frequent Visitor

Find Quarterly average event though the context of the table is daily

Hi,

I need my measure to calculate the average of the fullQuarter  eventhough i am displaying the measure for every date of the month.

 

I have contract sold on every day of the month and when I display the daily row data I want to also display the average of the corresponding quarter . eg Contract 'ABC' sold on the Feb 15th shows as say $500 , and let the average of the corresponding Quarter is $450. I created a measure with 'AllExcept ' so it will keep the context of the measure still in the quarter level event thought my measure needs to be displayed on a daily row basis.

 

Date                |     Contract ID            |       Sold Price            |          QuarterlyAverage

02/15/2019     |        ABC                    |         $500                  |          $450     

02/16/2019     |        JKL                      |         $200                  |          $450         

02/17/2019     |        POI                     |         $250                  |          $450             

_mQuarterlyAverage =CALCULATE( AVERAGE( TBL[Sold Price])
,ALLEXCEPT(TBL,'Date'[YearQuarter])
,TBL[statuscodename]= "Closed"
,TBL[StatecodeName]="Active"

)

 

YearQuarter represent the corresponding quarter of each date eg:2018 Q1, 2018 Q2 etc.

 

my measure keep calculating average for the full available year as oppose to the corresponding quarter.

please help me find what i am doing wrong. Thanks, JS

 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @Puthenveedu ,

Please try to update your measure as below.

_mQuarterlyAverage =
CALCULATE (
    AVERAGE ( TBL[Sold Price] ),
    FILTER (
        ALL ( TBL ),
        TBL[statuscodename] = "Closed"
            || TBL[StatecodeName] = "Active"
    ),
    VALUES ( 'Date'[YearQuarter] )
)

 

If it doesn't meet your requirement, Kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Puthenveedu ,

Please try to update your measure as below.

_mQuarterlyAverage =
CALCULATE (
    AVERAGE ( TBL[Sold Price] ),
    FILTER (
        ALL ( TBL ),
        TBL[statuscodename] = "Closed"
            || TBL[StatecodeName] = "Active"
    ),
    VALUES ( 'Date'[YearQuarter] )
)

 

If it doesn't meet your requirement, Kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
dm-p
Super User
Super User

Hi @Puthenveedu - did you try the DAX forum with this one? I suspect the answer would require using AVERAGEX with the ALLEXCEPT, rather than just AVERAGE but I think it's likely you'll get a faster and better quality answer if you post it over there.

Good luck!

Daniel





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

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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