Forum Discussion
IF or SWITCH statement depending on the selected value of another column
- 5 years ago
Hi Anonymous
SELECTEDVALUE(Append2[Currency]) ="BRL" is a logical condition statement, so it will always return a logical result True/False.
In your scenario, if your table structure is like below ("BRL" and "USD" are both in the Currency column), you could create a measure to calculate the value you need to populate the column chart. For example,
Amount measure = IF ( SELECTEDVALUE ( 'Table (3)'[Company] ) IN { "Company A", "Company B" }, CALCULATE ( SUM ( 'Table (3)'[Amount] ), 'Table (3)'[Currency] = "BRL" ), SUM ( 'Table (3)'[Amount] ) )You could modify the measure per your need.
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
Hi Anonymous
SELECTEDVALUE(Append2[Currency]) ="BRL" is a logical condition statement, so it will always return a logical result True/False.
In your scenario, if your table structure is like below ("BRL" and "USD" are both in the Currency column), you could create a measure to calculate the value you need to populate the column chart. For example,
Amount measure =
IF (
SELECTEDVALUE ( 'Table (3)'[Company] ) IN { "Company A", "Company B" },
CALCULATE ( SUM ( 'Table (3)'[Amount] ), 'Table (3)'[Currency] = "BRL" ),
SUM ( 'Table (3)'[Amount] )
)
You could modify the measure per your need.
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
This worked perfectly! Thank you so much!!