Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

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

 

2 ACCEPTED SOLUTIONS
MFelix
Super User
Super User

Hi @Anonymous ,

 

You should use a What if analisys. (https://docs.microsoft.com/en-us/power-bi/desktop-what-if)

 

This will create an auxiliary table that you can then use as a slicer and use a variable on your measures to make the calculations.

 

Regards,

MFelix

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

First, Create a What IF parameter.

dd8.PNG

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
)

 

dd9.PNG

Second, Create a [total cost] measure:

 

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

 

dd10.PNG

(Result visualization)

 

dd11.PNG

(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.

 

View solution in original post

2 REPLIES 2
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

First, Create a What IF parameter.

dd8.PNG

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
)

 

dd9.PNG

Second, Create a [total cost] measure:

 

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

 

dd10.PNG

(Result visualization)

 

dd11.PNG

(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.

 

MFelix
Super User
Super User

Hi @Anonymous ,

 

You should use a What if analisys. (https://docs.microsoft.com/en-us/power-bi/desktop-what-if)

 

This will create an auxiliary table that you can then use as a slicer and use a variable on your measures to make the calculations.

 

Regards,

MFelix

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.