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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
adharsr
New Member

Take the average for the particular date and populate across other dates

I have the table which has a column pricedate in it, and another table which has calendar date in it. I have to calculate the average price of the maximum pricedate and populate across other dates.
daxused = 

var folderdate = MAX('Append'[pricedate])
return  CALCULATE(AVERAGE('Append'[price]),ALLEXCEPT('calenderDate','calenderDate'[Date]),'calenderDate'[Date]=folderdate)
which calculates average Append[price] for each calenderDate[Date]

adharsr_0-1675704723572.png

what is expected is 

adharsr_1-1675704887685.png

thanks for your help!



1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @adharsr ,

You can update the formula of measure [daxused] as below and check if it can return the correct result...

daxused =
VAR folderdate =
    CALCULATE ( MAX ( 'Append'[pricedate] ), ALLSELECTED ( 'Append' ) )
RETURN
    IF (
        SELECTEDVALUE ( 'calenderDate'[Date] ) IN VALUES ( 'Append'[pricedate] ),
        CALCULATE (
            MAX ( 'Append'[price] ),
            FILTER ( ALLSELECTED ( 'Append' ), 'Append'[pricedate] = folderdate )
        )
    )

yingyinr_0-1675735990158.png

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @adharsr ,

You can update the formula of measure [daxused] as below and check if it can return the correct result...

daxused =
VAR folderdate =
    CALCULATE ( MAX ( 'Append'[pricedate] ), ALLSELECTED ( 'Append' ) )
RETURN
    IF (
        SELECTEDVALUE ( 'calenderDate'[Date] ) IN VALUES ( 'Append'[pricedate] ),
        CALCULATE (
            MAX ( 'Append'[price] ),
            FILTER ( ALLSELECTED ( 'Append' ), 'Append'[pricedate] = folderdate )
        )
    )

yingyinr_0-1675735990158.png

Best Regards

Thank you so much my problem is solved, heartful thanks to you 😄

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.