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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
rifat_tib
Frequent Visitor

Donut Chart Cross Filtering- Showing percentage of category in donut chart based on another filter

I have two charts. One Column and another Donut Chart.

SS-1.jpg

 

Two Table is like this: Country Performance Table-

CountryExport Performance
United States$2,326,723,898.20
Germany$1,632,408,827.56
Spain$870,604,150.10
France$665,835,911.01
INDIA$567,799,161.71
Netherlands$497,927,986.32
Italy$402,789,387.98
Japan$395,435,907.99
Canada$379,253,598.91
Poland$327,573,879.39
Denmark$263,984,534.89
Australia$253,274,283.61
Belgium$224,211,077.31
China$150,437,790.15

And Continent Table:

Region-ContinentCountry
North AmericaUnited States
EuropeGermany
EuropeSpain
EuropeFrance
AsiaINDIA
EuropeNetherlands
EuropeItaly
AsiaJapan
North AmericaCanada
EuropePoland
EuropeDenmark
OceniaAustralia
EuropeBelgium
AsiaUnited Arab Emirates
EuropeSweden
AsiaChina
EuropeTurkey
North AmericaMexico
EuropeCzech Republic


There is direct relationship between country column of two tables.

What I need is- when I will filter country by the column , the donut chart will show percentage of that country's performance against relevant continent's performance.

 

For Example- if I filter United States in Column Chart, the donut chart should show percentage of U.S's performance against North America Continent's Performance. Currently it is showing like this when I filtered-

SS-2.jpg

 

 

Is it possible?? I have tried Drill Down. But didn't work.. 

1 ACCEPTED SOLUTION
v-jialluo-msft
Community Support
Community Support

Hi @rifat_tib ,

 

Please follow these steps:

(1) Create a new measure

 

percentage =
VAR _VALUE =
    SUM ( 'Country Performance'[Export Performance] )
VAR _CONTINENT =
    CALCULATE (
        VALUES ( Continent[Region-Continent] ),
        Continent[Country] = MAX ( 'Country Performance'[Country] )
    )
VAR _TABLE =
    CALCULATETABLE (
        VALUES ( 'Continent'[Country] ),
        FILTER ( ALL ( Continent ), Continent[Region-Continent] = _CONTINENT )
    )
VAR _VALUE2 =
    CALCULATE (
        SUM ( 'Country Performance'[Export Performance] ),
        FILTER (
            ALL ( 'Country Performance' ),
            'Country Performance'[Country] IN _TABLE
        )
    )
RETURN
    DIVIDE ( _VALUE, _VALUE2, 0 )

 

 

(2)Final output

vjialluomsft_0-1669776717256.png

 

Best Regards,

Gallen Luo

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

View solution in original post

2 REPLIES 2
rifat_tib
Frequent Visitor

Thanks. Perfectly solves my problem! 🙂

v-jialluo-msft
Community Support
Community Support

Hi @rifat_tib ,

 

Please follow these steps:

(1) Create a new measure

 

percentage =
VAR _VALUE =
    SUM ( 'Country Performance'[Export Performance] )
VAR _CONTINENT =
    CALCULATE (
        VALUES ( Continent[Region-Continent] ),
        Continent[Country] = MAX ( 'Country Performance'[Country] )
    )
VAR _TABLE =
    CALCULATETABLE (
        VALUES ( 'Continent'[Country] ),
        FILTER ( ALL ( Continent ), Continent[Region-Continent] = _CONTINENT )
    )
VAR _VALUE2 =
    CALCULATE (
        SUM ( 'Country Performance'[Export Performance] ),
        FILTER (
            ALL ( 'Country Performance' ),
            'Country Performance'[Country] IN _TABLE
        )
    )
RETURN
    DIVIDE ( _VALUE, _VALUE2, 0 )

 

 

(2)Final output

vjialluomsft_0-1669776717256.png

 

Best Regards,

Gallen Luo

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

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.