Forum Discussion

Harry_Tran's avatar
Harry_Tran
Helper III
4 years ago

How to convert IF statement from SQL to DAX

Hi everyone,

I have a SQL query like this:

 

Total = Sum ( case 

                                when is_weekday = 'Y'

                                       and 

                                             (

                                                   (is_com_holiday = 'N')

                                               or (is_US_holiday = 'N')

                                               or (is_customer_holiday = 'N')

                                              )

                             then 1

                             else 0

                         end  )

from dbo.date d

join dbo.Maintable m

on fulldate >= SaleDate and fulldate <= create_date

 

Can someone please help me how to convert the query abow to DAX.

Thank you!

 

1 Reply

  • That seems to be straightforward. Use && and ||  and IN ()  . What have you tried and where are you stuck?