Forum Discussion
Count Rows Falling between two dates ( from disconnected table )
- 4 years ago
I still don't see an issue here
You need to display
'Table 1'[Created] and'Table 1'[Created +90] in the viz for the DAX to evaluate in the filter context. Without having that axis present, the expression will not evaluate.But if you do want to have that one displayed without bringing'Table 1'[Created] and'Table 1'[Created +90]then you need an index column and do this with a new measure
Hi,
Here is one way to do this:
Dax (calculated column):
Data model:
End result:
I hope this helps and if it does consider accepting this as a solution and giving a thumbs up!
- sagar5124 years agoHelper I
Thanks for the response; but unfortunately I cannot use the calculate function in the column, as I am working with powerbi data set (direct query).
Any way to do this in measure?
- ValtteriN4 years agoCommunity Champion
Hi,
It works almost exactly the same with a measure:
tickets_ =var _sdate = max('Task Table'[Created])var _edate = max('Task Table'[C90]) returncalculate(COUNT(Tickets[TN]),DATESBETWEEN('Calendar'[Date],_sdate,_edate))- sagar5124 years agoHelper I
thanks, but the problem with the above solution is I need to always keep the lowest level (Task number) into the context.
my end goal is to build some chart that aggregates to month level etc, but calculation should always stay at task number level and then aggregate.I think the column was the best fit in this scenario but unfortunately, I can't use it due to direct query 😞