Dax Switch statement - Need help in implementation
I need to implement a below logic in Power BI using DAX. I am unable to call the other tables(Purchase[Last_day],Timedim[Last_Day]) in the switch condition.
case when (( SALES.REQUEST_DT ) is null) or ( SALES.REQUEST_DT ) >= to_date('1-12-2005','MM-DD-YYYY') then 'P' when ( SALES.REQUEST_DT )<=( Purchase.Last_Day ) then 'PDue' when ( SALES.REQUEST_DT ) between to_date('08-10-2010','MM-DD-YYYY') and to_date('10-11-2010','MM-DD-YYYY') then 'BO' when ( SALES.REQUEST_DT ) between ( Timedim.Last_Day )+1 and to_date('01-10-2010','MM-DD-YYYY') then 'After' else to_char(to_date(Customer_Dt.FISCAL_MONTH || '/' || Customer_Dt.FISCAL_YEAR,'MM/YYYY'),'MON-YY') end
Need help how to implement this using Power BI. Any help is highly appreciated.
You may create relationships between the table 'SALES' and 'Purchase', 'SALES' and 'Timedim' on related date with Both of Cross filter direction, or these tables have been linked by intermediate tables such as Calendar table, then use RELATED function to get Purchase[Last_day] and Timedim[Last_Day] in formula.
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.