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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

if condition with date format table

I have a date table which has the date format in it. I want to use it in an if condition statement where if(date)=12/4/2020 , "show values of that date"  else 0. 

for the same i first created a measure to select value from the date table(as according to my knowledge the date format table cant be directly used or calculations):

 

measure= selectedvalue(date)

 

After that i wrote a formula:

if(sheet1[measure]=12/4/2020, goals,0) 

 

The value is coming to be 0 always even though there is a value of goals for that particular date

 

Can someone please help me out for the same

 

1 ACCEPTED SOLUTION
Pragati11
Super User
Super User

HI @Anonymous ,

 

Check the format of DATE column in dates table and the measure that you created.

Measure should return a date type value, so make sure it's format is exactly same to what the format of DATE column in dates table is.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try:

if(MAX(sheet1[date])=DATE(2020,12,4), goals,0)

If you want to reference a column in the measure, you need to aggregate it first. For date format values, you can't directly use text format. You need to use the date function to convert it to date format.


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Pragati11
Super User
Super User

HI @Anonymous ,

 

Check the format of DATE column in dates table and the measure that you created.

Measure should return a date type value, so make sure it's format is exactly same to what the format of DATE column in dates table is.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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