Forum Discussion
DarioSantos
9 years agoFrequent Visitor
How to calculate active subscriptions with an initial and final date
Hi, I have a table with subscriptions, in this table i have inicial date and final date. How i can for with day calculate the active subcription? In this table I have more information about the...
- 9 years ago
Hi Dario,
if you add a MIN and MAX to your "NumSubscriptions"-expression, it should work as a measure instead of a column (provided there is no (!) connection to the datedimension-table !):
NumSubscriptions = COUNTROWS( FILTER( Table1, Table1[InicialDate].[Date] <= MIN(datedimension[date]) && Table1[FinalDate] >= MAX(dateimension[date]) ) )
DarioSantos
9 years agoFrequent Visitor
Hi,
With new column in datedimension table.
NumSubscriptions =
COUNTROWS(
FILTER( Table1, Table1[InicialDate].[Date] <= datedimension[date] && Table1[FinalDate] >= dateimension[date] )
)
With one column for type and 1 line for each type I can add one more filter to do this.
My problem is this table in future is very big, if i can make this with a mesure is better.
Best Regards,
Dário Santos
ImkeF
9 years agoCommunity Champion
Hi Dario,
if you add a MIN and MAX to your "NumSubscriptions"-expression, it should work as a measure instead of a column (provided there is no (!) connection to the datedimension-table !):
NumSubscriptions =
COUNTROWS(
FILTER( Table1, Table1[InicialDate].[Date] <= MIN(datedimension[date]) && Table1[FinalDate] >= MAX(dateimension[date]) )
)