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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Switch dax using two tables

Hi All,

 

i wanna to write the code in power using DAX expression . 

(CASE

when se.worthless = 'Y' 

       then po.market_value_trade_date_base

when se.MINOR_SECURITY_TYPE_NUMBER IN (110, 115, 100)

       then po.market_value_trade_date_base

when po.market_value_trade_date_base = 0

       then po.fed_cost_trade_date_base

else po.market_value_trade_date_base

end) ADJUSTED_MV,

 

in the above code, there are two tables SE and PO . These two tables are mapped. 

 

Thanks

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

In DAX, they are very close. You could refer to the following DAX.

ADJUSTED_MV =
SWITCH (
    TRUE (),
    'SE'[worthless] = "Y", 'PO'[market_value_trade_date_base],
    'SE'[MINOR_SECURITY_TYPE_NUMBER] IN { 110, 115, 100 }, 'PO'[market_value_trade_date_base],
    'PO'[market_value_trade_date_base] = 0, 'PO'[fed_cost_trade_date_base],
    'PO'[market_value_trade_date_base]
)

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

1 REPLY 1
v-eachen-msft
Community Support
Community Support

Hi @Anonymous ,

 

In DAX, they are very close. You could refer to the following DAX.

ADJUSTED_MV =
SWITCH (
    TRUE (),
    'SE'[worthless] = "Y", 'PO'[market_value_trade_date_base],
    'SE'[MINOR_SECURITY_TYPE_NUMBER] IN { 110, 115, 100 }, 'PO'[market_value_trade_date_base],
    'PO'[market_value_trade_date_base] = 0, 'PO'[fed_cost_trade_date_base],
    'PO'[market_value_trade_date_base]
)

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors