Forum Discussion
suman-petlu
6 years agoFrequent Visitor
How to create measure columns using case statement based on condition in power bi
Hi all, I am new to power bi,please let me know how to execute below case statement CASE WHEN t3189.w_xact_type_code = 'Standard Invoice' THEN t4720.loc_exchange_rate * t4720.net_amt WHEN t31...
- 6 years ago
Hi,
Please try IF dax function:
Column = IF(RELATED('Table 2'[Date].[Year])=2000,'Table'[Amount]*'Table'[Quantity])And it shows:
Hope this helps.
Best Regards,
Giotto Zhi
az38
6 years agoCommunity Champion
Hi suman-petlu
try
Column = SWITCH([t3189.w_xact_type_code],
"Standard Invoice", [t4720.loc_exchange_rate] * [t4720.net_amt],
"Invoice Cancellation" ,- 1 *[t4720.net_amt] * [t4720.loc_exchange_rate],
0
)do not hesitate to give a kudo to useful posts and mark solutions as solution
- suman-petlu6 years agoFrequent Visitor
Hi az38 ,
I tried using Switch function but i didn't get desried results.Please help
But tried to multiply with Constant value ,its working as expected
Regards,
Suman
- amitchandak6 years agoSuper User
Try using this inside switch sumx(sales[Amount_sold]*sales[Quantity_sold])
Switch(times[calenderyear]="2000",sumx(sales[Amount_sold]*sales[Quantity_sold]))
- v-gizhi-msft6 years agoCommunity Support
Hi,
Please try IF dax function:
Column = IF(RELATED('Table 2'[Date].[Year])=2000,'Table'[Amount]*'Table'[Quantity])And it shows:
Hope this helps.
Best Regards,
Giotto Zhi