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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
deepakkumar456
Frequent Visitor

Power BI total Count for grouped value based on filter condition

Hello,
I have a table named XYZ and columns A and B as below - 

AB
Delhi1
Delhi2
Delhi3
Mumbai1
Jaipur2
Jaipur3
Hyderabad1
Chennai2
Nagpur3
Nagpur4

 

I need count of column B grouped by A as below - 

ACount of B
Delhi3
Mumbai1
Jaipur2
Hyderabad1
Chennai1
Nagpur2

 

and then need to show the Count of B > 1 in a tile in power bi. Could anyone please help me with this using DAX formula ?
Here result would be 3.

 

This is very easy in SQL but I am struggling in Power BI.

Thanks in advance !!

1 ACCEPTED SOLUTION
muhammad_786_1
Solution Supplier
Solution Supplier

Hi @deepakkumar456 

 

You can try this DAX to get your result:

Count_B_Greater_Than_1 = 
CALCULATE(
    COUNTROWS(
        FILTER(
            SUMMARIZE('Table', 'Table'[A], "Count_B", COUNT('Table'[B])),
            [Count_B] > 1
        )
    )
)

muhammad_786_1_0-1731591370484.png

 

Best Regards,
Muhammad Yousaf

 

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

 

LinkedIn

View solution in original post

2 REPLIES 2
deepakkumar456
Frequent Visitor

Thank you for helping so quickly 🙂 I really apreciate your efforts on this.

muhammad_786_1
Solution Supplier
Solution Supplier

Hi @deepakkumar456 

 

You can try this DAX to get your result:

Count_B_Greater_Than_1 = 
CALCULATE(
    COUNTROWS(
        FILTER(
            SUMMARIZE('Table', 'Table'[A], "Count_B", COUNT('Table'[B])),
            [Count_B] > 1
        )
    )
)

muhammad_786_1_0-1731591370484.png

 

Best Regards,
Muhammad Yousaf

 

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

 

LinkedIn

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.