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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
sabinocivita
Frequent Visitor

Complex query

Hi all,

I have a table with 3 columns: numjob, openedjobdate, closedjobdate. I want to have a visual matrix that has months as rows and as values distinct count of job opened and distinct count of job closed for each month.

How to do it?

 

Thanks in advance 

1 ACCEPTED SOLUTION

It can be like:

Count(Opendate) = Count(Table[numjob])
Count(Closedate) =  CALCULATE(count(Table[numjob]),USERELATIONSHIP(Table[closedjobdate],CalendarTable[Date]))

 

View solution in original post

4 REPLIES 4
PC2790
Community Champion
Community Champion

First of all you need to have a Calendar table with which your this table will have with.

Refer - Power BI Date or Calendar Table Best Method: DAX or Power Query? - RADACAD

Then have two relationship, one between Date from Calendar and openedjobdate(active)

The other between Date from Calendar and closedjobdate(inactive)

Then create two measures to count the number of jobs.

Please note for closeddate you will have to use USERELATIONSHIP dax

 

And at last in matrix, take month from Calendar table and the measures like this:

PC2790_0-1655897846637.png

 

Hi PC2790,

thanks for answer.

When you say "Then create two measures to count the number of jobs." on which columns are they based on? Cause I have only one column for numjob

It can be like:

Count(Opendate) = Count(Table[numjob])
Count(Closedate) =  CALCULATE(count(Table[numjob]),USERELATIONSHIP(Table[closedjobdate],CalendarTable[Date]))

 

Ok, very clear now, thanks a lot.

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.