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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kaichapter
Regular Visitor

Radar Chart comparison - aggregate data

I am trying to create a radar chart which allows me to aggregate data and allow me to control the aggregations with slicers. I have the following table with data ready prepared in Power Query with all the unpivoting done. The following table is called Sheet1.

IDContinentCountryCityYearAttributeValue
1EuropeGermanyBerlin2021F150
1EuropeGermanyBerlin2021F260
1EuropeGermanyBerlin2021F376
1EuropeGermanyBerlin2021F480
1EuropeGermanyBerlin2021F530
2AfricaNigeriaLagos2022F123
2AfricaNigeriaLagos2022F211
2AfricaNigeriaLagos2022F323
2AfricaNigeriaLagos2022F423
2AfricaNigeriaLagos2022F530
2AfricaNigeriaLagos2022F664
3AsiaJapanTokyo2021F134
3AsiaJapanTokyo2021F332
4AsiaJapanTokyo2021F145

 

Averaging everything for the year is easy, with an extra table named Year, with one column also named Year and 2 rows, 2021 and 2022. This column goes into a slicer.

2021
2022

The category will be Sheet1[Attribute] and the following measure going to the Y Axis:

_value-slicer_Avg = SWITCH(SELECTEDVALUE('Year'[Year]),
2021,
CALCULATE(AVERAGE(Sheet1[Value]),Sheet1[Year]=2021),
2022,
CALCULATE(AVERAGE(Sheet1[Value]),Sheet1[Year]=2022)
)

This yields the average for a year of choice, when I drop the Year column of the Year table into the slicer

kaichapter_0-1660857393763.png

 

What I want to be able to, is to add another dataset on top of it, which would be easy in case of the data of an ID only (see the Individual Comparison tab of the attached pbix), thanks to the answer posted by Maggie here radar chart filtered comparison 

Duplicating the table in PowerQuery (no relations needed) as below...

kaichapter_1-1660857779640.png

 ...I need to create these measures:

_slicer_individual_selection = 
        SELECTEDVALUE(Sheet1_New[ID])
_value-slicer_individual_selection = 
        CALCULATE(AVERAGE(Sheet1[Value]),FILTER(Sheet1, Sheet1[ID] = [_slicer_individual_selection]))

And drop the ID of the Sheet1_New table in another slicer.

kaichapter_2-1660858171479.png

 


What I want however, is for the second dataset to be the set of the averages of the IDs selected, and the selection should be available at Continent, Country, City or ID level (see the Aggregate Comparison tab of the pbix file attached).

My attempt is not correct, but for the sake of illustration, here it is:

I have replaced the following measure in the Y Axis of the radar chart: 

 

_value-slicer_individual_selection


with this one

 

_value-slicer_multiple_selection = 
        CALCULATE(AVERAGE(Sheet1[Value]),FILTER(Sheet1, Sheet1[ID] IN ALLSELECTED(Sheet1_New[ID])))
kaichapter_3-1660858638373.png

 

It also doesn't let me see all the continents, countries, cities or IDs available, I have to keep selecting things to make them show up. I want to be able to show the aggregate set of any selection of IDs based on the supersets available (continent, country, city) as the second set on top of the original aggregate per year. In the above example, I want to see the average for all the data from Tokyo (please note: for 2021 only) as the second set.

Also, I want the 4 slicers on the right-hand side to update, so that I only get to select the ones for 2021 when the selected Year is 2021 and the same for 2022.

Attachments are not supported, please download them from here: https://drive.google.com/drive/folders/1aHS0kFCIUe407bS59VF_MUhrLygc5wfh

1 REPLY 1
v-stephen-msft
Community Support
Community Support

Hi @kaichapter ,

 

You want to compare two different datasets (depending on your different slicer selections), right?

According to Maggie's method, you need to create separate tables for the results of your two datasets to provide fields for the slicer.

 You wan to be available at Continent, Country, City or ID level, it is recommend that you create calculated tables to extract individual tables.

 

Best Regards,

Stephen Tao

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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