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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
nirman
Advocate IV
Advocate IV

Conditional visibility of a chart in Power BI report

I have created a report using Power BI desktop. The report is having two different charts.

 

Chart A is of "Clustured Column Chart", whereas the Chart AB is "Area chart". Both the charts are using the same Dataset.  Chart A is suppose to display some calculations for month-wise, whereas the chart B is suppose to display data based on the month selected in chart A. 

 

Now both the above charts are working correctly. The only problem is when nothing is selected in chart A, then the chart B displays analysis data for all months which I don't want to happen. I would rather want chart B to display blank when nothing is selected in chart A. Or may be hide chart B from the report and should be visible as soon as user selects something in chart A.

 

Could anyone please suggest, how can we set this kind of behavior in PowerBi reports?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Could chart B use a new calculated measure that sets its value to zero when more than one month is selected?

Something like:

NewMeasure:=IIF(count(months) > 1 , 0 , OldMeasure)

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Could chart B use a new calculated measure that sets its value to zero when more than one month is selected?

Something like:

NewMeasure:=IIF(count(months) > 1 , 0 , OldMeasure)

Anonymous
Not applicable

I do have same kind of requirement, but when I use I get below error message

 

Error Message:

MdxScript(Model) (1, 60) Calculation error in measure 'IM - Infy Data'[Action Test]: The function COUNT takes an argument that evaluates to numbers or dates and cannot work with values of type String.

 

What would be the solution for that.

 

Thanks,

 

Mi2n
Microsoft Employee
Microsoft Employee

@Anonymous, you will have to use COUNTA() instead of COUNT() for strings.

Anonymous
Not applicable

Actually the logic here is that, when we select single list of value from Chart A, then my second chart has to display selected data value.

 

but somehow my out is coming zero for single selection and more selections.

 

not sure where is the wrong in this formula.

 

Thanks

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors