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
Anonymous
Not applicable

Count returning less results when using Date Table

Hi there, 
Currently working on a project for work which contains multiple DateTime columns. 
I'm having an issue when using a calendar table, where the incorrect value is returned compared to when using a date column outside the calendar table. 
DAX Measure. 

Tasks Count = (COUNT(FM_Task_Detail[Task Sequence]))


The model:

 

TaskModel.PNG

 
I have added bi directional relationships to allow filter propogation from ResourceTeams through to TaskDetail and Task Performance.

 

Below is an example of the incorrect count.

Incorrect Count.PNG

 

 Below is an example of the expected result. In this example I'm using the Task Reported Date which resides in the Task Detail table with Task Sequence which I am counting. 

Correct Count.PNG

 


Any ideas on what is causing rows to be ommitted from the filter context? Rather confused. 

Unable to provide sample data unfortunately.


Thanks,
Ross

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I have found a solution. 
In this instance, I created an  inactive relationship between Task Detail and Dates. 

From there I added Calculate with USERELATIONSHIP to enforce the correct date filter context. 

Thanks,
Ross

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

I have found a solution. 
In this instance, I created an  inactive relationship between Task Detail and Dates. 

From there I added Calculate with USERELATIONSHIP to enforce the correct date filter context. 

Thanks,
Ross

Greg_Deckler
Super User
Super User

What are the relationships between those three tables? Dates, Task_Detail and Time_Records. It would appear that for some reason the relationship between Dates and Time_Records is filtering out certain tasks in Task_Detail.

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

So, One Task Sequence in Task Detail can have Many related rows in Time Records. 
For example. Task Sequence 1 could have Time Record Sequences 1,2 and 3. 

In short, many time record sequence numbers can be related to a single Task Sequence number.

The relationship between Time Records and the date table is based on DateKey. Duplicated from 'Time Record Started' formatted to Date rather than date time. This connects to the FullDate in the Dates table. 

Thanks,
Ross

Anonymous
Not applicable

@Greg_Deckler It's also worth noting that there are multiple date columns. Task Reported Date and Time Record Started Date could have dates which are different. (An engineer task which takes multiple visits for example) 

@Anonymous - Right and the multiple date columns are likely where some of the issues like. What dates or other colums are Task_Details and Time_Records related on? 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.