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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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