I am trying to create a DAX measure as below. when the Col1 = B0 or Col1 = B1 I would like to sum otherwise i would like to multiple with rate and sum. How to get around with this ? many thanks in advance.
CALCULATE (
SWITCH( TRUE() ,
'myDF'[Col1] = "B0" or 'myDF'[Col1] = "B1",
SUMX ('myDF', 'myDF'[Amount]),
SUMX( 'myDF',
'myDF'[Amount]*'myDF'[Rate] )),
KEEPFILTERS( 'myDF'[Col2] = "Bla" )
)
Try this
SWITCH( TRUE() ,
'myDF'[Col1] = "B0" or 'myDF'[Col1] = "B1",
'myDF'[Amount], 'myDF'[Amount]*'myDF'[Rate] )