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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
akina
New Member

What-if Parameters as Slicer and showing aggregated results

Hi,

 

I'm new to Power BI and I could say that the community is really great and full of talented Power BI experts.

 

I hope you could help me with this:

I want my slicer to be a one-box, numeric input type, in such a way that I could just enter a whole number, not range. And I know that What-if parameter could do that.

 

However, another thing I want is, given the example below where 'Age' is my filter (not AgeGroup since I don't want a dropdown), I would like my charts to show the aggregate value or summary of the age group based on the Age I input.

 

Example, if I input 51 in my What-if parameter slicer, instead of filtering my charts among 51 years old only, the charts would be filtered based on the corresponding age group of the age entered. So, if I enter 51 in my slicer, the resulting filter would be the whole '40-59 years old' including other ages which would give me 'Black' and 'White' as the favorite colors of my age group. 

 

AgeAgeGroupFaveColor
5140-59 years oldBlack
6060+ years oldBlack
3030-39 years oldBlue
5740-59 years oldBlue
7760+ years oldWhite
7260+ years oldWhite

 

Is this possible? Hope you could help me. Thanks a lot!

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @akina 

 

You can try the following methods.

Measure:

Measure =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Table'[AgeGroup] )
        = SWITCH (
            TRUE (),
            SELECTEDVALUE ( Parameter[Parameter] ) >= 30
                && SELECTEDVALUE ( Parameter[Parameter] ) <= 39, "30-39 years old",
            SELECTEDVALUE ( Parameter[Parameter] ) >= 40
                && SELECTEDVALUE ( Parameter[Parameter] ) <= 59, "40-59 years old",
            SELECTEDVALUE ( Parameter[Parameter] ) >= 60, "60+ years old"
        ), 1,
    BLANK ()
)

Put Measure in the Filter of the view and set it equal to 1.

vzhangti_0-1649039342017.png

The results are shown in the figure.

vzhangti_1-1649039404435.pngvzhangti_2-1649039419420.png

 

Best Regards,

Community Support Team _Charlotte

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-zhangti
Community Support
Community Support

Hi, @akina 

 

You can try the following methods.

Measure:

Measure =
SWITCH (
    TRUE (),
    SELECTEDVALUE ( 'Table'[AgeGroup] )
        = SWITCH (
            TRUE (),
            SELECTEDVALUE ( Parameter[Parameter] ) >= 30
                && SELECTEDVALUE ( Parameter[Parameter] ) <= 39, "30-39 years old",
            SELECTEDVALUE ( Parameter[Parameter] ) >= 40
                && SELECTEDVALUE ( Parameter[Parameter] ) <= 59, "40-59 years old",
            SELECTEDVALUE ( Parameter[Parameter] ) >= 60, "60+ years old"
        ), 1,
    BLANK ()
)

Put Measure in the Filter of the view and set it equal to 1.

vzhangti_0-1649039342017.png

The results are shown in the figure.

vzhangti_1-1649039404435.pngvzhangti_2-1649039419420.png

 

Best Regards,

Community Support Team _Charlotte

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

Hi @v-zhangti , thank you for this! It's working! Saved me a lot of time. You're amazing!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors
Top Kudoed Authors