Forum Discussion
Getting Month and Year from a Datetime field with DirectQuery
Hello,
I have a report where I want to show hourly, daily, monthly and yearly data.
It all worked fine expect for the monthly overview.
I tried it like this:
Hi,
thanks for your answers. Sadly they both did not work.
But I found a solution that works for me:
DATE(YEAR('Table'[date]), MONTH('Table'[date]), 1)
Best Regards
Noah
4 Replies
- AnonymousNot applicable
Hi noah44 ,
I tried your operation and found this error.
You can convert the "." inside to "/" so that it can be displayed.
DATEVALUE(MONTH(smrt_eigenverbrauch_wert[Zeit]) & "/" & YEAR(smrt_eigenverbrauch_wert[Zeit]))Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- noah44Helper I
Hi,
thanks for your answers. Sadly they both did not work.
But I found a solution that works for me:
DATE(YEAR('Table'[date]), MONTH('Table'[date]), 1)
Best Regards
Noah