Forum Discussion
Average YTD by category
- 8 years ago
Hi GeorgiBarov,
You could try to create the measure below to get your desired output.
average_ytd = TOTALYTD ( AVERAGE ( demo[Quantity] ), 'Table'[Date], FILTER ( ALL ( demo ), 'demo'[Assay] = MAX ( 'demo'[Assay] ) ) )The output is below.
If you need additional help please share your expected output.
Best Regards,
Cherry
Hi GeorgiBarov,
You could try to create the measure below to get your desired output.
average_ytd =
TOTALYTD (
AVERAGE ( demo[Quantity] ),
'Table'[Date],
FILTER ( ALL ( demo ), 'demo'[Assay] = MAX ( 'demo'[Assay] ) )
)The output is below.
If you need additional help please share your expected output.
Best Regards,
Cherry
Hi v-piga-msft and thank you for the reply
I tried your formula but it calculate the AVG([Quantity]) only if there is one [Quantity] per day.
If we have a few records of Quantity related to a one day the formula is wrong.
In the table above Quantity is automaticaly summurized, but actualy there are a few records per day
Here are the examples:
Expected value on 01-DEC-2016 / average_ytd is: 205 not 102.5
Thank you :)