Forum Discussion
Problem with formula
- 4 years ago
AlexisPREVOT , You should always use date table for time intelligence function
CALCULATE(DISTINCTCOUNT('Marketing COMMANDE'[REFERENCE_COMMANDE]), dateadd('Date'[Date],-1, Year))
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uATime Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs
AlexisPREVOT , You should always use date table for time intelligence function
CALCULATE(DISTINCTCOUNT('Marketing COMMANDE'[REFERENCE_COMMANDE]), dateadd('Date'[Date],-1, Year))
Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs
- AlexisPREVOT4 years agoResolver I
Thank you amitchandak for your response.
I'm going to try this formula by creating a date table but I must be extremely useless because even if I manage to create this table without any problems, I'm completely lost for its use...
- v-chenwuz-msft4 years agoCommunity Support
Hi AlexisPREVOT ,
Or you can calculate distinctcount without create a date table with your date column 'Marketing COMMANDE'[DATE_COMMANDE], but all() must be add if no date table.
Some measures like this.
Measure =
CALCULATE (
DISTINCTCOUNT ( 'Marketing COMMANDE'[REFERENCE_COMMANDE] ),
ALL ( 'Table' ),
DATEADD ( 'Marketing COMMANDE'[REFERENCE_COMMANDE], -1, YEAR )
)Actually, the date table amitchandak mentioned is used to filter the date column [DATE_COMMANDE]. Which has one to many relationship to your date column [DATE_COMMANDE].
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.