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
ahines
Advocate I
Advocate I

What If Parameter Help

Hello, 

 

I am currently playing around with the new What If parameters and had a question. Does anyone know if you can set the What If Parameter to one specific category?

 

If I have Category A, B, C and want to see how the What If parameter effected just Category A, can I do that? I know you cant put a visual filter in the field of the what if parameter, but was looking for another way. 

 

If this is not possible, this should be added to this as soon as possible. 

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@ahines

 

Hi, the what if parameter create a measure (SelectedValue) 

 

You can use this measure to combine in another measure with your aggregation by category.

 

Something like:

 

In a discount Scenario: 

 

UnitsSold=SUM(MyTable[Units])
UnitsSold_to_A_with_Parameter =
CALCULATE ( [UnitsSold], FILTER ( MyTable, MyTable[Category] = "A" ) )
    - (
        CALCULATE ( [UnitsSold], FILTER ( MyTable; MyTable[Category] = "A" ) )
            * Parameter[Parameter Value]
    )

 

 

UnitsSold with Parameter =
CALCULATE (
    [UnitsSold],
    FILTER ( MyTable, MyTable[Category] <> "A" )
)
    + [UnitsSold_to_A_with_Parameter]

Also you can view this PBIX.

 

https://drive.google.com/file/d/0B95C8CKdTZE3dnNiTFo3cGF0bW8/view?usp=sharing

 

img.png 

 

Regards

 

Victor

Lima - Peru




Lima - Peru

View solution in original post

2 REPLIES 2
Vvelarde
Community Champion
Community Champion

@ahines

 

Hi, the what if parameter create a measure (SelectedValue) 

 

You can use this measure to combine in another measure with your aggregation by category.

 

Something like:

 

In a discount Scenario: 

 

UnitsSold=SUM(MyTable[Units])
UnitsSold_to_A_with_Parameter =
CALCULATE ( [UnitsSold], FILTER ( MyTable, MyTable[Category] = "A" ) )
    - (
        CALCULATE ( [UnitsSold], FILTER ( MyTable; MyTable[Category] = "A" ) )
            * Parameter[Parameter Value]
    )

 

 

UnitsSold with Parameter =
CALCULATE (
    [UnitsSold],
    FILTER ( MyTable, MyTable[Category] <> "A" )
)
    + [UnitsSold_to_A_with_Parameter]

Also you can view this PBIX.

 

https://drive.google.com/file/d/0B95C8CKdTZE3dnNiTFo3cGF0bW8/view?usp=sharing

 

img.png 

 

Regards

 

Victor

Lima - Peru




Lima - Peru

Thank you. That is very helpful! 

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.