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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
AnneMi
Frequent Visitor

Count if a variable is related

Hi, 

How can I count how many of column: "number" that has a value in column "Test" that is related to table "Special". 

 

I have two columns in table 1: "Number" and "Test". I want to know how many number that has the same value in "Test" and "Special".  

 

AnneMi_0-1670834990214.png

 

AnneMi_0-1670921831942.png

 

 

 

 

3 REPLIES 3
AnneMi
Frequent Visitor

Thanks for the answer. If I do the first suggestion; How do I write the dax? 

I tried the erarlier, but I got an error-message. 


Do you know if there are other options? 

amitchandak
Super User
Super User

@AnneMi , where is sepcial.

 

One way is to have a common table of numbers and then join with both columns and count them. With inactive join, you will use userelationship

 

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

https://amitchandak.medium.com/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-solutio...

 

 

Another one is count column like

 

countx(filter(Table, Table[Special] = earlier(Table[Tes]) ), Table[Special])

 

Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi, Thanks for the answer. I got this results: 

 

AnneMi_0-1670921669261.png

But I just want to know how many of "Number" that has a special value. In this case, it is 1 for 1, and 1 for 10. 

 

 

 

 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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