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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
he2mpo
Frequent Visitor

CountRows with UseRelationship is not working

I have a table with Schedule of Tasks. Each task has two dates start and finish.

The main goal is to count the number of tasks by date while maintaining relationship with the tasks to keep crossfiltering

 

I created two relationships between Calendar table and my Tasks Table

he2mpo_0-1687418316542.png

 

and then I created measures to calculate row counts

 

 

cnt_finishes = 
CALCULATE(
    COUNTROWS(TASKS),
    USERELATIONSHIP('Calendar'[Date], TASKS[Finish])
)

 

 

This did not work and I am getting weired results. I am wondering what am I doing wrong

 

he2mpo_1-1687418485348.png

 

I have uploaded a sample pbix file and excel file containing the data to this folder Count UseRL

 

 

 

1 ACCEPTED SOLUTION
he2mpo
Frequent Visitor

I actually found the solution which was pretty silly.

In the query editor the dates columns have to be of type Date and Not date/time

So the solution was as easy as changing the type of both start and finish columns to Date.

View solution in original post

4 REPLIES 4
he2mpo
Frequent Visitor

I actually found the solution which was pretty silly.

In the query editor the dates columns have to be of type Date and Not date/time

So the solution was as easy as changing the type of both start and finish columns to Date.

It's always the obvious solutions that are the hardest. Good job tho, will def come in handy to know!

314mp_M0th4
Resolver I
Resolver I

A quick fix would be to scrap the measures and the calendar table and use a matrix with only the starts and finish dates. Like this:

314mp_M0th4_0-1687423448302.png

This gives the matrix visual:

314mp_M0th4_1-1687423481762.png

 

If you found this helpfull please give me thumbs up and if ths solved your problem please mark this as the solution.

 

Thanks for trying to help but I need to have them linked to calendar table as I have many measures to be combined in a single chart.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors