Forum Discussion
Anonymous
7 years agoNot applicable
DAX
Hello, I am new to Power BI, and for the moment trying DAX. I was able do calculate a measure for the Year to Date sum of a value with following formula: Somme YTD = TOTALYTD(SUM(Sheet1[ETP ...
Anonymous
7 years agoNot applicable
Hi Maggie, I tried this also, but it doesn't work.
Both
Somme YTD 1 = TOTALYTD(SUM(Sheet1[ETP Mensuel]);Sheet1[Date deb mois].[Date])
Somme YTD 2 = CALCULATE(SUM(Sheet1[ETP Mensuel]);DATESYTD(Sheet1[Date deb mois].[Date]))
work fine as long as I do a SUM, but if I replace SUM by AVERAGE, it does a wrong calculation:
Both
Moyenne YTD 1 = TOTALYTD(AVERAGE(Sheet1[ETP Mensuel]);Sheet1[Date deb mois].[Date])
Moyenne YTD 2 = CALCULATE(AVERAGE(Sheet1[ETP Mensuel]);DATESYTD(Sheet1[Date deb mois].[Date]))
give values like 142, 150, and so on, instead of the correct YTD means which are about 1570.
I see that in your example there is not the .[Date] after the date field, but this doesn't change the result.
But anyway thank you for your help, I will try to see why your solution and what I tried doesn't work.
Have a nice day,
Best regards,
Barbara
v-juanli-msft
7 years agoCommunity Support
Hi Anonymous
Is this problem sloved?
If it is sloved, could you kindly accept it as a solution to close this case?
If not, please let me know.
Best Regards
Maggie