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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
BartzD01
Regular Visitor

Count IF

I have a table that contains a product "100000" which is produced at 2 plants 1352 and 1353.

Every plan consumes each own material code (ex. 1352: 200001..200004 & 1353: 200005...200009).

The total produced volume for 1352: 10 and for 1353:20. However the volume 10 & 20 is repeattest photo 3.pnged becuase of the materials. I want one column to devide the times occurence of product 100000 at plant 1352"  10/5 times and 1353"  10/6 times. I used the formula at the picture test to count how many times occures a join of plant&product but did not worked because I guess there is a conflict with the other colums a well. Your help will be gratefull 

 

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

[Sales]
/
Calculate(
Countrows(Table),
ALL(table),
[Plant] = Earlier([Plant]),
[Product] = Earlier([Product])
)

Connect on LinkedIn

View solution in original post

2 REPLIES 2
tex628
Community Champion
Community Champion

[Sales]
/
Calculate(
Countrows(Table),
ALL(table),
[Plant] = Earlier([Plant]),
[Product] = Earlier([Product])
)

Connect on LinkedIn
Anonymous
Not applicable

Hi @BartzD01 ,

 

Please try below measure, it works on my desktop version:

test = CALCULATE(COUNTROWS(Table4),ALL(Table4[MATERIAL],Table4[Sales]))

Aiolos Zhao

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.