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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Rebender
Frequent Visitor

Separate distinct count of one column for two different other columns

Hi!  Newbie here!  What I am trying to accomplish is create a visual that shows a distinct count of WPS # by month for each 1CR_Associate_ID and 2CR_Associate_ID. The associate Id can be in either column so I need a different count depending on which column their ID is in.

 

2018-07-23 15_46_04-Clipboard.png

1 ACCEPTED SOLUTION
v-yuta-msft
Community Support
Community Support

Hi Rebender,

 

To achieve your requirement, create two calculate columns using DAX below:

Count in 1CR_Associate_ID = CALCULATE(DISTINCTCOUNT(Table1[WPS #]), FILTER(Table1, MONTH(Table1[Start Date]) = MONTH(EARLIER(Table1[Start Date])) && Table1[1CR_Associate_ID] = EARLIER(Table1[1CR_Associate_ID])))

Count in 2CR_Associate_ID = CALCULATE(DISTINCTCOUNT(Table1[WPS #]), FILTER(Table1, MONTH(Table1[Start Date]) = MONTH(EARLIER(Table1[Start Date])) && Table1[2CR_Associate_ID] = EARLIER(Table1[2CR_Associate_ID])))

捕获.PNG 

 

Regards,

Jimmy Tao

View solution in original post

4 REPLIES 4
v-yuta-msft
Community Support
Community Support

Hi Rebender,

 

To achieve your requirement, create two calculate columns using DAX below:

Count in 1CR_Associate_ID = CALCULATE(DISTINCTCOUNT(Table1[WPS #]), FILTER(Table1, MONTH(Table1[Start Date]) = MONTH(EARLIER(Table1[Start Date])) && Table1[1CR_Associate_ID] = EARLIER(Table1[1CR_Associate_ID])))

Count in 2CR_Associate_ID = CALCULATE(DISTINCTCOUNT(Table1[WPS #]), FILTER(Table1, MONTH(Table1[Start Date]) = MONTH(EARLIER(Table1[Start Date])) && Table1[2CR_Associate_ID] = EARLIER(Table1[2CR_Associate_ID])))

捕获.PNG 

 

Regards,

Jimmy Tao

Thank you so much for your help!  That worked great!  I have one question....  When I add those new columns to my visual it is summing them so that I get an incorrect value.  Do you know how or which visual  I can create that will just display the value?  Here is what I am working with now.  It is a Matrix.....

2018-07-24 08_42_07-Profile Approval Reports - Power BI Desktop.png

Hi Rebender,

 

Click on the new columnns, click Modeling-> Default Summarization-> Select "Don't Summarize" or in the Values field of matrix chart select "Don't summarize". Check if it can work.

 

Regards,

Jimmy Tao

I had already tried that, but for some reason I am getting the same value for both columns (1CR, and 2CR)

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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