Forum Discussion
Column with SWITCH statement
- Anonymous6 years ago
Hi RickPowerBI ,
Please create a Calculated Column.
IF1 Column =SWITCH(TRUE (),'Table'[Quantity] < 0 && 'Table'[CreditInvoice] = True, - ( 'Table'[Quantity]),'Table'[Quantity] > 0 && 'Table'[CreditInvoice] = True , 'Table'[Quantity],'Table'[Quantity] < 0 && 'Table'[CreditInvoice] = FALSE ,'Table'[Quantity],'Table'[Quantity] > 0 && 'Table'[CreditInvoice] = FALSE(), 'Table'[Quantity])Regards,
Harsh NathaniDid I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi RickPowerBI ,
Please create a Calculated Column.
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
- RickPowerBI6 years agoHelper I
You're an absulute legend! Thank you very much.
- Anonymous6 years agoNot applicable
- Anonymous6 years agoNot applicable
Hi ,
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')
endNeed help how to implement this using Power BI. Any help is highly appreciated.
Thanks in advance.