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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
aaditya2000
Helper II
Helper II

CALCULATE help

Hello:

 

I want the COUNT of Batch# for all storename for each customer. below is the screenshot.

 

I am looking for something like this.

XYZ-->ALL storename-->Count of all Batch#

MEASURE = 4 (all stores) X 16 (count of batch)

 

Need help how i can do that.

 

Any help is greatly appreciated.

 

thanking in advance.

 

Thanks

 

Table.png

6 REPLIES 6
Anonymous
Not applicable

@aaditya2000,

Firstly, select the three columns in TABLE-1, then select “Remove Duplicates”.
1.PNG

Secondly, create relationship between TABLE-1 and TABLE-2 using ID field.

Thirdly, create the following measures in TABLE-1 and create table visual.

Count of stores = DISTINCTCOUNT('TABLE-1'[storename])
Count of batch = CALCULATE(COUNT('TABLE-2'[Batch1#]))
Measure 2 = [Count of stores]*[Count of batch]
2.PNG

Regards,

Hello:

 

Thank you for your reply. The solution you provided is doable, but i amnot seeing filtering cutomer in the measure calculations.

 

I see customer names in table but not in measure calculations.

 

Is it i am missing something over here?

 

Please help.

 

Thanking in advance.

 

Thanks

Anonymous
Not applicable

@aaditya2000,

When you add customer field in table, the measure is calculated by customer. You can remove customer field from the above table visual and you will see the measure result is different.

Regards,
Lydia

dilumd
Impactful Individual
Impactful Individual

Hi,

 

Below function will consider all columns in your data table except Batch # column,

 

Count of Raws = CALCULATE(COUNTROWS(CountRaws),ALLEXCEPT(CountRaws,CountRaws[Batch#]))

CountRaws.JPG

 

However, if you use below formula with ALL function it will ignore all filters inside the table.

 

Count of Raws = CALCULATE(COUNTROWS(CountRaws),ALL(CountRaws[Batch#]))

CountRaws1.JPG

 

 

Thank you for your reply. want to know how i can do that where based on customer, i want to total count = total stores X count of batch.

 

for e.g = 4 stores X count of batch (4)

           = 16.

 

thanks

dilumd
Impactful Individual
Impactful Individual

you can use SUM or SUMX functions based on your ultimate goal.

 

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors