cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Abevann
Helper II
Helper II

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
Resident Rockstar
Resident Rockstar

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
Resident Rockstar
Resident Rockstar

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

Thanks a lot Denis! 

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.