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

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

Reply
jbmmobile
Frequent Visitor

Count of rows with two conditions -different tables

Hello,

 

table 1.JPGTable 2.JPG

 

Need help with counting. I would like to have a calculated column table1[column2] with the total qty for value "000001_UPS_P_RES" in table2[ship method code] counted by table[invoice date] using table1[date] as the reference to match the dates

 

So for ship method code 000001_UPS_P_RES I would like to count how many time it appears for Invoice Date in table 2 using the date column in table 1  and displayed in table1[column2] 

 

I hope this makes sense. Thanks in advance for the help

 

 

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

Probably multiple ways of doing this, here is one.

 

In ShipCode table (table 2), create a measure like:

 

mCountShipCodes = COUNTROWS(ShipCodes) 

Make sure your tables are related on date.

 

Create table visualization that has [Date] (from table 1), ShipCode from table 2, and your measure.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Eric_Zhang
Microsoft Employee
Microsoft Employee

@jbmmobile

If no relationship between two tables, you can also try

Column2 = COUNTROWS(FILTER(Table2,Table2[ship method code]="000001_UPS_P_RES"&&Table2[invoice date]=Table1[Date]))

View solution in original post

2 REPLIES 2
Eric_Zhang
Microsoft Employee
Microsoft Employee

@jbmmobile

If no relationship between two tables, you can also try

Column2 = COUNTROWS(FILTER(Table2,Table2[ship method code]="000001_UPS_P_RES"&&Table2[invoice date]=Table1[Date]))
Greg_Deckler
Community Champion
Community Champion

Probably multiple ways of doing this, here is one.

 

In ShipCode table (table 2), create a measure like:

 

mCountShipCodes = COUNTROWS(ShipCodes) 

Make sure your tables are related on date.

 

Create table visualization that has [Date] (from table 1), ShipCode from table 2, and your measure.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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!

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.