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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DianaT
Helper I
Helper I

Counting number of volunteer who did more than one job each quarter

Hi all,

 

I'm trying to visualise the count of volunteers who undertook more than one jobs in each quarter. My dataset is like the below.

 

Volunteer IDYear-QuarterJOB ID
10012019 Q1A
10012020 Q1A
10022020 Q1B
10032019 Q4C
10032020 Q1C
10032020 Q1D
10032020 Q2C
10042020 Q1E
10052019 Q4F
10052019 Q4G

 

And what I'm trying to achieve is to present the total count in a card, which interacts with a filter by Year-Quarter.

 

However all I managed so far is getting the count through a table visual... For instance, there is the table visual I get when I set Year-Quarter filter to 2020 Q1:

 

Volunteer ID(Distinct) Count of Job ID(Distinct) Count of Volunteer ID
100111
100211
100321
100411
Total54

 

I then further filter this table by (Distinct) Count of Job ID >1

 

Volunteer ID(Distinct) Count of Job ID(Distinct) Count of Volunteer ID
100321
Total21

 

And the total (Distinct Count of Volunteer ID) is what I want to visualise.

 

I'm pretty sure there is a more elegant way to do this via DAX. Any help/advice will be greatly appreciated.

 

Many thanks,

Diana

 

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

I haven't given this much of a test.  See how you get on.

MeasureVVV = VAR _tab = SUMMARIZECOLUMNS(TableV[Volunteer ID], TableV[Year-Quarter],
                                             "DCount", DISTINCTCOUNT(TableV[JOB ID]))
RETURN
COUNTROWS(FILTER(_tab, [DCount] > 1))

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Shouldn't the answer be 2 on a card visual - Volunteer ID 1003 and 1005?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi Ashish,

 

Thanks for your message. ID 1005 should be counted in this case as I also have a filter in the scenerio "Year-Quarter" = 2020 Q1.

 

Diana

HotChilli
Super User
Super User

I haven't given this much of a test.  See how you get on.

MeasureVVV = VAR _tab = SUMMARIZECOLUMNS(TableV[Volunteer ID], TableV[Year-Quarter],
                                             "DCount", DISTINCTCOUNT(TableV[JOB ID]))
RETURN
COUNTROWS(FILTER(_tab, [DCount] > 1))

Thank you so much. This works beautifully.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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