Forum Discussion
Anonymous
4 years agoNot applicable
Dax measure
Hi
I have a weighted average for Yield but it is for all years in the data set which is 2021 and 2022 however instead of adding a filter to say only show 2022 i want it to be a dynamic dax measure which will change according to the years in the future too. therfore need a measure which gives it back as ytd.
the weighted average measure is:
IEA*Yield =
Sumx( 'Sales Report - Detail',' Sales Report - Detail'[IEA]*[yield]
)
Weighted Average Yield =
DIVIDE([IEA*Yield], SUM('Sales Report - Detail'[IEA])
2 Replies
- Greg_Deckler
Community Champion
Anonymous Maybe:
Measure = CALCULATE([IEA*Yield],FILTER(ALL('Dates'),YEAR('Dates'[Date])=YEAR(TODAY()) && 'Dates'[Date] <= TODAY()))
- V-lianl-msft
Community Support
Hi Anonymous ,
Please try:
Measure = TOTALYTD(
[Weighted Average Yield],
Date[Order_Date],
Date[Order_Date] < TODAY()
)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.