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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
alks_skla_f
Frequent Visitor

Pie chart base on slicer selection

Hello, I have 4 measures:

'All data with group speciality'[Day Case count] // returns number
'All data with group speciality'[Inpatient Count] //returns number

 

'All data with group speciality'[Day Case count current year] //returns number
'All data with group speciality'[Inpatient Count current year] // return number


Pie chart visualisation connected to DAX formula:

Case type = IF(
    'All data with group speciality'[selected value] = "All",
    'All data with group speciality'[Day Case count] && 'All data with group speciality'[Inpatient Count], // return 2 measures in pie chart
    'All data with group speciality'[Day Case count current year] && 'All data with group speciality'[Inpatient Count current year] // return 2 mesures in pie chart
)

However, this doesn't work. I don't have any error, but my pie chart is blank. Any idea how can I correct DAX formula?

3 REPLIES 3
Anonymous
Not applicable

Hi @alks_skla_f ,

 

It seems that your [Case type] is a calculated column. I think "&&" in your case type code will return boolean like Ture or False. If you want to return number type result, I suggest you to try "+" as FarhanJeelani mentioned above.

If his reply could solve your issue please mark it as a solution and more people will benfenit from it.

If you still have questions, please share a sample file with us. I think you issue should be caused by your data model.

You can also share a screenshot with the result you want to us. We also need to know the four measures' calculate logic.

 

Best Regards,
Rico Zhou

 

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

FarhanJeelani
Super User
Super User

Hi @alks_skla_f ,

Try 


Case Type =
IF(
'All data with group speciality'[selected value] = "All",
'All data with group speciality'[Day Case count] + 'All data with group speciality'[Inpatient Count], // Sum of both measures for "All"
'All data with group speciality'[Day Case count current year] + 'All data with group speciality'[Inpatient Count current year] // Sum of both measures for current year
)

It will not work as I need. This formula just sums two values and in the end I return one value in pie chart. However, I need to return two values in pie chart.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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