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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
buddycho
Regular Visitor

Help with Dynamic Pie Chart DAX

I have a table called "2017-2023 FDI" with the columns "Year" "NE" "County" "FDI Country" "CapEx" "Jobs" "SSP Industry". In the NE column the cells have either "N" to represent new projects and "E" to represents expanding projects. A count is taken of the entries in the "NE" column to determine the Total Projects as well as a count of "N" in the "NE" column can be taken to determine the number of new projects and a count of "E" in the "NE" column can be taken to determine the number of expanding projects. Cells in the "FDI Country" column list the country where the FDI originated. I want to have a pie chart where the value is "CapEx" and the Legend is the Top 5 FDI Countries by total "CapEx" with the remainder FDI countries grouped under the single category other. I want a second pie chart where the value is "Jobs" and the Legend is the same as above. I want a third pie chart where the value is project count (Count of "NE") and the Legend is the same as above. This means that each pie chart should have 6 pieces

 

I keep getting an error that the syntax for "Rank" is incorrect, I am not sure how to proceed. I tried using all measures instead of having a calculated column that groups countries into "Top 5" or "Other" but realized I could not put a measure in the Legend field. The new table I created is called "Metrics"Screenshot 2024-12-03 102741.png

Screenshot 2024-12-03 103403.png       Screenshot 2024-12-03 103516.png    Screenshot 2024-12-03 103328.png

1 ACCEPTED SOLUTION
johnt75
Super User
Super User
1 REPLY 1
johnt75
Super User
Super User

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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