Forum Discussion
Ruksuro
9 years agoHelper III
Trend from History Table
Hi Community! Apologies if this has been raised previously or is very simple but I can't seem to find a clear soltuion to the following... Given a source history table (think subscriptions to...
- 9 years ago
You may refer to the following DAX that creates a new table.
Table = ADDCOLUMNS ( CALENDARAUTO (), "Count", CALCULATE ( DISTINCTCOUNT ( Table1[Customer ID] ), FILTER ( Table1, Table1[Subscribed From] <= [Date] && ( Table1[Subscribed Until] > [Date] || ISBLANK ( Table1[Subscribed Until] ) ) ) ) )
v-chuncz-msft
9 years agoCommunity Support
You may refer to the following DAX that creates a new table.
Table =
ADDCOLUMNS (
CALENDARAUTO (),
"Count", CALCULATE (
DISTINCTCOUNT ( Table1[Customer ID] ),
FILTER (
Table1,
Table1[Subscribed From] <= [Date]
&& (
Table1[Subscribed Until] > [Date]
|| ISBLANK ( Table1[Subscribed Until] )
)
)
)
)
Ruksuro
9 years agoHelper III
Thanks for this v-chuncz-msft, worked perfectly.
Just for everyone else's information, this solution is not fast (given it's having to count each row multiple times it's not surprising). For a large dataset you might want this info precalculated at source.
Very impressed with DAX so far!