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.
Hello,
I need to be able to produce counts for the total number of subscriptions that were active as of December 31st each year. This is the kind of raw data I have:
Subscription ID | Valid From | Valid To |
123-XYZ | 01/01/2021 | 31/12/2021 |
456-ABC | 04/10/2020 | 31/12/2021 |
If they were all complete years like the top row, I would just use the Valid To date. However, records like the bottom row needs to be identified as active on both 31st December 2020 and 2021.
I ultimately want to be able to get something like this:
Year-End | Count of Subscriptions |
2020 | 1 |
2021 | 2 |
Any ideas?
Many thanks!
Solved! Go to Solution.
Hi @s--turn ,
You can try this measure.
Count of Subscriptions =
CALCULATE (
COUNT ( 'Table'[Subscription ID] ),
FILTER (
'Table',
'Table'[Valid From] <= MAX ( 'Calendar'[Date] )
&& 'Table'[Valid To] >= MAX ( 'Calendar'[Date] )
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @s--turn ,
You can try this measure.
Count of Subscriptions =
CALCULATE (
COUNT ( 'Table'[Subscription ID] ),
FILTER (
'Table',
'Table'[Valid From] <= MAX ( 'Calendar'[Date] )
&& 'Table'[Valid To] >= MAX ( 'Calendar'[Date] )
)
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
97 | |
82 | |
67 | |
61 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |