Help! PowerBI - How to 'COUNTIFS' with conditions

AnetShe

New Member
Joined
Apr 27, 2017
Messages
20
I've attached a snapshot of my data - I'm looking to count how many shipping addresses a Partner ID has in a list of various Partner IDs.
In the image the power BI formula I need is:
- For Partner ID# PUS00000111 to show it has 14 'TRUE' shipping address values
- For Partner ID# PUS00000342 to show it has only 1 'TRUE' shipping address

I have come up with two formulas that are close but both are giving me incorrect values.

This one below is counting all 'TRUE' shipping address values for all Partner IDs, not just the 1 Partner ID in the row (I can't get it to just count for that row's Partner ID).
It is showing incorrect counts for the example Partner #s above - it is showing 15 (count of 'TRUE' shipping address values) for everything.
CALCULATE(COUNTROWS(t_b2b_na_partner_address),FILTER(t_b2b_na_partner_address,t_b2b_na_partner_address[SHIPPING_ADDRESS]="TRUE"),allexcept(t_b2b_na_partner_address,t_b2b_na_partner_address[PARTNER_ID]))

Any help would be amazing to figure out what can work to get the above counts needed - thank you!!
 

Attachments

  • CountIfs.jpg
    CountIfs.jpg
    82.3 KB · Views: 14

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I've figured it out - posting here encase helpful for anyone, this is the formula that worked:
CALCULATE(COUNTA(t_b2b_na_partner_address[SHIPPING_ADDRESS]),ALLEXCEPT(t_b2b_na_partner_address,t_b2b_na_partner_address[PARTNER_ID]),t_b2b_na_partner_address[SHIPPING_ADDRESS]="TRUE")
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,151
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top