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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors