Forum Discussion
DAX Newbie Count Rows by Date Filter
- 1 year ago
Posting to state that after much research, I have solved the problem. I have one date table that has multiple relationships with the other table. When creating formulas involving "inactive" relationships, I needed to active that relationship.
Example: Cases Due:=CALCULATE(
COUNTROWS('RS Cases'),USERELATIONSHIP(Date_Table[Date],'RS Cases'[Due By]))
HI Txtcher ,
Try This
Backlog:= CALCULATE(
COUNTROWS(
FILTER(
ALL('RS Cases'), -- Remove all filters from the entire table
'RS Cases'[Due By] < TODAY() && -- Check if Due Date has passed
(
ISBLANK('RS Cases'[Entrance Date]) || -- Check if Entrance Date is blank
'RS Cases'[Entrance Date] > 'RS Cases'[Due By] -- Check if Entrance Date is past Due Date
)
)
)
)
Changes made:
- ALL('RS Cases'): Removed filters from the entire table instead of just the column. This is generally safer as it allows for broader context removal.
Additional Considerations:
- If you specifically want to keep filters on other columns while ignoring just the Entrance Date, you can adjust the logic depending on your needs.
- If this doesn't resolve the error, please provide more details about the context in which this measure is being used, such as the specific error message or the model structure, so I can assist further!
Thank you again for your patience and prompt response.
Unfortunately, the measure did not give me the count I want.
I want a rolling count of the number of intakes that were not worked from month to month. For example, as of Nov 1, 2023, how many cases were overdue? Then on Dec 1, 2023, how many overdue.
The measure when placed into the pivot table, did not provide the desired results: