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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Seven
Regular Visitor

Group by with Filter

Hello,

 

I have the Data like this:

 

                  Hobbies          Country

Mark          Swimming       Germany

David         Football           Italy

Maria         Swimming       Germany

Peter          Biking              Italy

 

 

Now I would like to create a column chart in Power by where I can set the Filter "Country"

So in the chart the "Top"-favourite Hobbies should be displayed with a Count of the Hobby. With a slicer, I would like to choose the country "ALL","Germany","Italy"

 

The result should be:

 

Chart for All countries:

Swimming: 2

Football: 1

Biking: 1

 

Chart for Germany:

Swimming: 2

 

Chart for Italy:

Football: 1

Biking: 1

 

 

 

I hope you can understand and help me.

 

Thank you very much.

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

HI @Seven,

 

You can refer to below graph to know how to create a visualization to achieve your requirement.

33.gif

 

Regards,

Xiaoxin Sheng

View solution in original post

Anonymous
Not applicable

Hi @Seven,

 

You can switch visual type to line and clustered column chart and use below measure as line value:

Analytic Line = 
DIVIDE (
    CALCULATE (
        COUNT ( Table1[Name] ),
        VALUES ( Table1[Hobbies] ),
        VALUES ( Table1[Country] )
    ),
    CALCULATE ( COUNT ( Table1[Name] ), ALLEXCEPT ( Table1, Table1[Country] ) ),
    -1
)

Regards,

Xiaoxin Sheng

View solution in original post

4 REPLIES 4
Seven
Regular Visitor

Hello,

 

I have the Data like this:

 

                  Hobbies          Country

Mark          Swimming       Germany

David         Football           Italy

Maria         Swimming       Germany

Peter          Biking              Italy

 

 

Now I would like to create a column chart in Power by where I can set the Filter "Country"

So in the chart the "Top"-favourite Hobbies should be displayed with a Count of the Hobby. With a slicer, I would like to choose the country "ALL","Germany","Italy"

 

The result should be:

 

Chart for All countries:

Swimming: 2

Football: 1

Biking: 1

 

Chart for Germany:

Swimming: 2

 

Chart for Italy:

Football: 1

Biking: 1

 

 

 

I hope you can understand and help me.

 

Thank you.

 

Anonymous
Not applicable

HI @Seven,

 

You can refer to below graph to know how to create a visualization to achieve your requirement.

33.gif

 

Regards,

Xiaoxin Sheng

Hi Xiaoxin Sheng,

 

thank you very much. This is helping a lot.

 

Is it now possible to set a constant line, which is different for every filter.

 

The line should bei the total count of people of every country.

e.g. 2 german people are swimming. In the data there 4 germans. So it should be made clear (with the line at 4), that half of the Germans are swimming.

 

Regards,

Sven

 

Anonymous
Not applicable

Hi @Seven,

 

You can switch visual type to line and clustered column chart and use below measure as line value:

Analytic Line = 
DIVIDE (
    CALCULATE (
        COUNT ( Table1[Name] ),
        VALUES ( Table1[Hobbies] ),
        VALUES ( Table1[Country] )
    ),
    CALCULATE ( COUNT ( Table1[Name] ), ALLEXCEPT ( Table1, Table1[Country] ) ),
    -1
)

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.