Count Distinct Values Pivot Table

nburaq

Board Regular
Joined
Apr 2, 2021
Messages
222
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi,
I would like to count distinct values based on the combination of multiple columns.(In sample Location+Item+Status) I added my table as data model to count distinct values but it does not give correct results. I know how to distinct count using helper column or excel function like =IF(COUNTIFS($C$2:C2,C2,$B$2:B2,B2)>1,0,1)but is there any way to do it in power pivot ? as calculated column or measure? Thanks for comments and help

LocationItemStatusDistinct Count
KitchenPlatesMoved
1​
KitchenSpoonsStayed
1​
SaloonTVMoved
1​
SaloonChairMoved
2​
SaloonChairMoved
2​
BathroomMirrorStayed
1​
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
For multiple columns, the best way to do it is concatenate those columns into one column (maybe separated by a dash or a colon) and then take a distinct count of that column by adding to the data model and using distinct count under value field settings
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,194
Members
452,616
Latest member
intern444

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