Why won't the Day function reference my dates column in Power BI?

Owen Laurie 21 Reputation points
2022-07-15T14:56:12.177+00:00

I am trying to run a DAX calculation to clean up my dates. I want to create an IF function that checks if a date is on the 1st of the month, and if it is, subtracts 1 day to put it at the end of the previous month. However, I find myself unable to reference my dates column using the day function. Here is the syntax I am trying to use:

Date (Corrected) = CALCULATE(IF(DAY("date")=1,DATEADD("Date",-1,DAY),"date"))

SQL Server Analysis Services
SQL Server Analysis Services
A Microsoft online analytical data engine used in decision support and business analytics, providing the analytical data for business reports and client applications such as Power BI, Excel, Reporting Services reports, and other data visualization tools.
1,248 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dillon Silzer 54,746 Reputation points
    2022-07-15T16:05:03.753+00:00

    I believe that you will receive better support on the Power BI forums located at https://community.powerbi.com/t5/DAX-Commands-and-Tips/bd-p/DAXCommands

    There are many more people there with more experience in Power BI DAX Functions.

    -------------------

    If this helps you please mark as correct answer.


0 additional answers

Sort by: Most helpful