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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Abevann
Helper III
Helper III

Dates comparision in an IF

Guys,

 

I been working with this dashboard, and is confusing; the targuet is to have in % meta dist a division of incomings and target; the conditios is if the starting date in the slider is before 01/01/2021 (January 1rst 2021) then I should have a "No aplica", and if it occurs after, then the result of the division should be showed. In the example the date is December 27th 2020, so the leyend "No aplica" should be on the card.

Abevann_1-1614632204112.png

 

 

Any suggestion? Thanks a lot, regards,

Abelardo

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @Abevann ,

 

if you want to check for a date you have to compare against a date. Use the DATE function in DAX to create a fixed date:

DATE(2021, 01, 01)

 

If you just write "01/01/2021" you do a division, so 01 / 01 = 1 / 2021 = 0.0004948(...)

If you have any questions, just let me know. If my answer was helpful, I would be happy if you could give me a thumbs up.

 

Best regards

Denis

View solution in original post

2 REPLIES 2
selimovd
Super User
Super User

Hey @Abevann ,

 

if you want to check for a date you have to compare against a date. Use the DATE function in DAX to create a fixed date:

DATE(2021, 01, 01)

 

If you just write "01/01/2021" you do a division, so 01 / 01 = 1 / 2021 = 0.0004948(...)

If you have any questions, just let me know. If my answer was helpful, I would be happy if you could give me a thumbs up.

 

Best regards

Denis

Thanks a lot Denis! 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.