The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
Age | AgeGroup | FaveColor |
51 | 40-59 years old | Black |
60 | 60+ years old | Black |
30 | 30-39 years old | Blue |
57 | 40-59 years old | Blue |
77 | 60+ years old | White |
72 | 60+ years old | White |
Is this possible? Hope you could help me. Thanks a lot!
Solved! Go to Solution.
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.
The results are shown in the figure.
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, @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.
The results are shown in the figure.
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!