Forum Discussion
Use different values in measure dependent on a user defined preference
- 7 years ago
Hey Nickodemus
I prefer to create a multi select slicer that contains all the products, for this it's necessary to create a separate table, that is not related to the table that contains the Columns "Cost A" and "Cost B".
Then I created this measure:
Use Cost B if ticked = var checkIsFiltered = ISFILTERED('Products using Cost B'[Product]) var theBProducts = VALUES('Products using Cost B'[Product]) return SUMX( VALUES('Fact'[Product]) ,IF(AND(checkIsFiltered , 'Fact'[Product] in theBProducts) , CALCULATE(SUM('Fact'[Cost B])) , CALCULATE(SUM('Fact'[Cost A])) ) )This allows to create something like this:
Hopefully this is what you are looking for.
Regards,
Tom
Hey Nickodemus
I prefer to create a multi select slicer that contains all the products, for this it's necessary to create a separate table, that is not related to the table that contains the Columns "Cost A" and "Cost B".
Then I created this measure:
Use Cost B if ticked =
var checkIsFiltered = ISFILTERED('Products using Cost B'[Product])
var theBProducts = VALUES('Products using Cost B'[Product])
return
SUMX(
VALUES('Fact'[Product])
,IF(AND(checkIsFiltered , 'Fact'[Product] in theBProducts)
, CALCULATE(SUM('Fact'[Cost B]))
, CALCULATE(SUM('Fact'[Cost A]))
)
)
This allows to create something like this:
Hopefully this is what you are looking for.
Regards,
Tom
- Nickodemus7 years agoHelper III
Thank you very much for such a fast response!
It worked perfectly!!
TomMartens wrote:Hey Nickodemus
I prefer to create a multi select slicer that contains all the products, for this it's necessary to create a separate table, that is not related to the table that contains the Columns "Cost A" and "Cost B".
Then I created this measure:
Use Cost B if ticked = var checkIsFiltered = ISFILTERED('Products using Cost B'[Product]) var theBProducts = VALUES('Products using Cost B'[Product]) return SUMX( VALUES('Fact'[Product]) ,IF(AND(checkIsFiltered , 'Fact'[Product] in theBProducts) , CALCULATE(SUM('Fact'[Cost B])) , CALCULATE(SUM('Fact'[Cost A])) ) )This allows to create something like this:
Hopefully this is what you are looking for.
Regards,
Tom