Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

DAX comparison operations

Hi,

I am new to DAX and Power BI and I having some problems with the bellow formula.

INF - IF ([DateTime ]«DATE (YEAR (TODAY ()), MONTH (TODAY ()), 1), 1, 0)

DAX comparison operations do not support comparing values of type Text with
values of type Date. Consider using the VALUE or FORMAT function to convert one
of the values. 

How can I fix this formula? Any help will be very appreciated. 

Thank you! 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

Yes, you are correct. The text data type was DateTime. I figured it out by adding Value(DateTime).

INF = IF (Value([DateTime ])«DATE (YEAR (TODAY ()), MONTH (TODAY ()), 1), 1, 0).

Thank you for replying to my message. 

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

Hi @Anonymous 
Which one is the text data taype column?

Anonymous
Not applicable

Hi,

Month is the text data type

@Anonymous 
MONTH here is a function not a column and this function returns integer value from 1-12 that is the month number.

Anonymous
Not applicable

Hi,

Yes, you are correct. The text data type was DateTime. I figured it out by adding Value(DateTime).

INF = IF (Value([DateTime ])«DATE (YEAR (TODAY ()), MONTH (TODAY ()), 1), 1, 0).

Thank you for replying to my message. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.