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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
brunomitsuo
Frequent Visitor

Dynamic Slider as What-if text and value

Hello Everyone!

 

I need some help doing some simulations with food products and it's costs for a Lunch/Breakfast menu that contains Fruit, Drink, Meat, Salad.

 

I have a list of products that can be alternatives for that food group, and i wish to swap a food option for another of the same group, and it's cost. It's not necessary to substitute more than one food at the same time.

 

As an example below, i choose April 1st, and wish to swap Juice 1 of Drink group for a product selected from List of Alternatives slicer (juice 7) and also its cost and total.

 

I tried using table relationship between tables, but my List of Alternatives, actually contains around 2.000 SKU (Fruit + Drink + Meat + Salad) and that will take too long to complete the table.

Can anyone give me a hand? Many Thanks!!!

 

File example in the end of message.

 

Dynamic Sliders Test.png

 

 

 

 

 

 

 

 

 

 

 

 

 

pbix file

excel tables file

1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @brunomitsuo 

You may create a table as slicer.Then create measures to get the new food and cost.Attached sample file for your reference.

Cost_New =
IF (
    HASONEVALUE ( 'Table'[Food] ),
    SUMX (
        Doubts,
        IF ( Doubts[Food] = MAX ( 'Table'[Food] ), SUM ( LOP[Cost] ), Doubts[Cost] )
    )
)
Food_New = 
IF (
    HASONEVALUE ( 'Table'[Food] ),
    IF (
        MAX ( Doubts[Food] ) = MAX ( 'Table'[Food] ),
        MAX ( LOP[Food] ),
        MAX ( Doubts[Food] )
    )
)

Regards,

Community Support Team _ Cherie 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-cherch-msft
Employee
Employee

Hi @brunomitsuo 

You may create a table as slicer.Then create measures to get the new food and cost.Attached sample file for your reference.

Cost_New =
IF (
    HASONEVALUE ( 'Table'[Food] ),
    SUMX (
        Doubts,
        IF ( Doubts[Food] = MAX ( 'Table'[Food] ), SUM ( LOP[Cost] ), Doubts[Cost] )
    )
)
Food_New = 
IF (
    HASONEVALUE ( 'Table'[Food] ),
    IF (
        MAX ( Doubts[Food] ) = MAX ( 'Table'[Food] ),
        MAX ( LOP[Food] ),
        MAX ( Doubts[Food] )
    )
)

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey @v-cherch-msft  !

 

That's amazing ! It worked just great! Super thanks!

 

I will try to use it on my real database. Smiley Very Happy

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.