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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.