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
Anonymous
Not applicable

Count the number of times an item appears in 2 columns

Hello everyone,

I want to make a ring graph from this table:

 

florian245_0-1688475888495.png


This situation represents the case where there are visits to a site by 2 people each time, a visitor and a co-visitor.

 

I would like to make a ring graph which displays the number of occurrences of each first name.

 

For example, Albin should be worth 3 on my graph (1 visitor and 2 co-visitors).

 

But every time I try to do this I can't find the method for a long time.

 

If anyone has a solution or any ideas, I'd love to hear from you 🙂

Thanks everyone!

3 REPLIES 3
Anonymous
Not applicable

Thanks a lot guys ! database is not my thing ahha

 

Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Count the number of times.pbix

Screen Capture #1369.pngScreen Capture #1370.pngScreen Capture #1371.pngScreen Capture #1373.png

 

barritown
Super User
Super User

Hi @Anonymous,

I'd solve your task with an additional table (Modeling -> New Table) like this:

barritown_0-1688481678819.png

In plain text:

people = 
ADDCOLUMNS (
    DISTINCT ( 
        UNION ( 
            SELECTCOLUMNS ( data, "person", [visiteur] ), 
            SELECTCOLUMNS ( data, "person", [co visiteur] ) ) ),
    "count", 
    COUNTROWS ( FILTER ( data, [visiteur] = [person] ) ) + COUNTROWS ( FILTER ( data, [co visiteur] = [person] ) ) )

 

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

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.