Make number representation selectable in matrix visual for specific values in Power BI

35 Views Asked by At

I have the following report.

enter image description here

Here, the user has the option to select different values, which are then displayed in the matrix visual. Since the numbers are very large, I want the user to have the option to directly select whether the EUR figures are displayed in EUR or million EUR in the matrix. The Sum Quantity should always be displayed as usual, and for Sum EUR and Sum DiffEUR, the Power BI report user can choose how he want it to be displayed, either in EUR or million EUR.

Is there any way to solve this?

Here is a link to my test pbix-report: https://www.dropbox.com/scl/fi/6m3kjpqsn4efbsv6kcf09/StackOverflow-78001472-1.pbix?rlkey=fyo80t9zom17fewkskewo5v2t&dl=0

1

There are 1 best solutions below

4
Amira Bedhiafi On

You need to capture the user selection :

SelectedValType = SELECTEDVALUE(ValOptions[ValType], "Sum EUR")

Then the EURorMillionEUR_Display measure which takes into account the user selection and displays the EUR and DiffEUR accordingly :

EURorMillionEUR_Display = 
VAR SelectedValType = [SelectedValType] // This is a reference to the SelectedValType measure
VAR SumEUR = SUM(valueData[EUR])
VAR SumQuantity = SUM(valueData[Quantity])
VAR DiffEURCalc = [diffValue] // This is a reference to the diffValue measure
VAR ConversionFactor = IF(SelectedValType = "Sum EUR" || SelectedValType = "DiffEUR", 1000000, 1)
RETURN
    SWITCH(
        SelectedValType,
        "Sum EUR", SumEUR / ConversionFactor,
        "Sum Quantity", SumQuantity,
        "DiffEUR", DiffEURCalc / ConversionFactor,
        SumEUR // Default to SumEUR if nothing is selected or recognized
    )

enter image description here

enter image description here

enter image description here