Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi all,
I have a Bar Chart on my report page
But it doesn't look good if a user selects multiple channels
I want to deliver a message if channel count > 1, else deliver bar chart
How can I do that?
Thanks
w
Solved! Go to Solution.
Hi @tecumseh ,
Thanks for hnguy71's reply!
If you mean that when the user makes multiple selections, a pop-up warning will appear, or the original bar chart will be changed to a card chart to display information, then I'm sorry that this is not possible in Power BI.
I can give you a workaround:
Here is my sample data:
Use this DAX to create a measure:
Sum of Value =
VAR _sum =
CALCULATE(
SUM('Table'[Value]),
ALL('Table'),
'Table'[Channel] <= SELECTEDVALUE(Slicer[Channel]) && 'Table'[ID] = MAX('Table'[ID])
)
RETURN
IF(
COUNTROWS(VALUES(Slicer[Channel])) > 1,
BLANK(),
_sum
)
Then create the bar chart (column chart):
Use this DAX to create another measure:
ShowMessage =
IF(
ISFILTERED(Slicer[Channel]),
IF(
COUNTROWS(VALUES(Slicer[Channel])) > 1,
"Please select only one channel to view the bar chart.",
BLANK()
),
"Please choose one channel"
)
Then create a Card(New) and put the measure into it:
Click Card > Visual > Callout values > Values > enter a space in the field under Show blank as:
Then go to Cards > Background > Change Transparency to 100%:
Also close the Border:
Then overlap the Card (New) and the bar chart:
And the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @tecumseh ,
That's a great idea from @v-junyant-msft ! I'd like to expand on it by providing a more detailed explanation while considering the user experience. The goal is to prevent the card from overlapping the column chart when the user wants to make a selection and make the column chart dissapear completely if more than one value was selected in the slicer.
First, create a measure to check if the slicer has exactly one selected value:
isOneSelected =
IF(
HASONEVALUE(financials[Product]), // Use the same field from your slicer that filters the bar chart
1,
0
)
Now, suppose your bar chart displays the total sales amount by country. Modify the sales amount measure as follows:
Sales Amount =
IF(
[isOneSelected] = 1,
SUM(financials[Sales]),
BLANK()
)
This ensures that sales data is only displayed when a single selection is made.
Next, create a measure to show a message when multiple selections are made:
TextOutPut =
IF(
[isOneSelected] = 0,
"Multiple selections not allowed",
""
)
At this point, the column chart is there, but it looks like nothing has changed. However, the labels are still visible.
To hide the labels dynamically:
At this point, the bar chart should disappear completely when multiple selections are made.
Now, just add a slicer, and your final result should look like this:
However, as @hnguy71 mentioned, if your goal is simply to force the user to select only one value in the slicer, you can achieve this with a built-in setting:
This approach ensures that the user can only select one value at a time, preventing multiple selections automatically.
Hi @tecumseh ,
Thanks for hnguy71's reply!
If you mean that when the user makes multiple selections, a pop-up warning will appear, or the original bar chart will be changed to a card chart to display information, then I'm sorry that this is not possible in Power BI.
I can give you a workaround:
Here is my sample data:
Use this DAX to create a measure:
Sum of Value =
VAR _sum =
CALCULATE(
SUM('Table'[Value]),
ALL('Table'),
'Table'[Channel] <= SELECTEDVALUE(Slicer[Channel]) && 'Table'[ID] = MAX('Table'[ID])
)
RETURN
IF(
COUNTROWS(VALUES(Slicer[Channel])) > 1,
BLANK(),
_sum
)
Then create the bar chart (column chart):
Use this DAX to create another measure:
ShowMessage =
IF(
ISFILTERED(Slicer[Channel]),
IF(
COUNTROWS(VALUES(Slicer[Channel])) > 1,
"Please select only one channel to view the bar chart.",
BLANK()
),
"Please choose one channel"
)
Then create a Card(New) and put the measure into it:
Click Card > Visual > Callout values > Values > enter a space in the field under Show blank as:
Then go to Cards > Background > Change Transparency to 100%:
Also close the Border:
Then overlap the Card (New) and the bar chart:
And the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @tecumseh ,
Have you thought about disabling multi-select and force select on your users to only have one channel selected at a time?
Thanks @hnguy71 ,
Users need to be able to select all channels to see company total.
Looks like some great options on this thread to deliver a message to users to "disable" channel detail charts in these instances.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.