Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Interactive info-graphics.

Hi all, 

 

I would like to present total figures via the use of infographics based on cost per case and number of cases.

 

However, I  would like yo allow the user to introduce the number of cases he/she is interested in. Is it possible to have an interactive measure that adjusts the total costs (and linked infographics) based on the cases the final user decides? Or the measures can only be based on a fixed number of cases introduced in POWER BI (via tables).

 

Many thanks!

 

Nucamo

 

  • Hi Anonymous ,

    First, Create a What IF parameter.

    Second, modify the DAX formula of the [Parameter Value] mearue:

     

    Number of case = 
    VAR x =
    SELECTEDVALUE('Parameter'[case number], 1)
    VAR y = 
    CALCULATE(
        COUNT(Sheet2[Case]),
        ALLEXCEPT(
            Sheet2,
            Sheet2[Cost]
        )
    )
    RETURN
    IF( 
        ISFILTERED(Parameter[case number]) && y=x ,
        x
    )

     

    Second, Create a [total cost] measure:

     

    total cost = 
    CALCULATE(
        SUM(Sheet2[Cost]),
        FILTER(
            Sheet2,
            [Number of case]
        )
    )

     

    (Result visualization)

     

    (Original data table) 

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

2 Replies

  • v-lionel-msft's avatar
    v-lionel-msft
    Community Support

    Hi Anonymous ,

    First, Create a What IF parameter.

    Second, modify the DAX formula of the [Parameter Value] mearue:

     

    Number of case = 
    VAR x =
    SELECTEDVALUE('Parameter'[case number], 1)
    VAR y = 
    CALCULATE(
        COUNT(Sheet2[Case]),
        ALLEXCEPT(
            Sheet2,
            Sheet2[Cost]
        )
    )
    RETURN
    IF( 
        ISFILTERED(Parameter[case number]) && y=x ,
        x
    )

     

    Second, Create a [total cost] measure:

     

    total cost = 
    CALCULATE(
        SUM(Sheet2[Cost]),
        FILTER(
            Sheet2,
            [Number of case]
        )
    )

     

    (Result visualization)

     

    (Original data table) 

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.