Function Format In DAX Not Allowed In DirectQuery Calculated Columns When Formatting Dates
Good evening fellow developers,
I have a scenario wherein I will set the default value of a slicer to the current month by default. A link in the forums presented the solution below.
Since, I'm using DirectQuery connection, the Format() function isn't allowed in calculated columns. After doing some tweaking on my column, the fix that I've come up with was to extract the month and year individually and concatenate them and return that value to the Current Month column.
Cheers.. :)
I have a scenario wherein I will set the default value of a slicer to the current month by default. A link in the forums presented the solution below.
Current Month = IF(MONTH('Transactions'[transdate])=Month(NOW()) && YEAR('Transactions'[transdate]) = YEAR(NOW()), "Current Month", Format('Transactions'[transdate], "YYYY mmmm"))
Current Month = IF(MONTH('Transactions'[transdate])=Month(NOW()) && YEAR('Transactions'[transdate]) = YEAR(NOW()), "Current Month", Year('Transactions'[transdate]) & "/" & Month('Transactions'[transdate]))
Cheers.. :)
Comments
Post a Comment