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.
We've recently started using a temporal table for our data. Because of this we have records showing Valid To & Valid From dates.
I've created a measure to calculate the number of customers that are open on any given day. The measure below works at the DAY level, but when you use a date hierarchy includes all recrods that were valid at any point during that month, not just as of the last day of that month.
Total Open Customers =
CALCULATE(
COUNT('IA Dim_Customer'[CustomerKey]),FILTER('IA Dim_Customer',
'IA Dim_Customer'[Status] = "Open"
&& 'IA Dim_Customer'[ValidFrom].[Date] <= max('IA Dim_Date'[FullDate])
&& 'IA Dim_Customer'[ValidTo].[Date] > min('IA Dim_Date'[FullDate])))
Below are pictures that illustrate the issue better.
Solved! Go to Solution.
Hello,
If i understand correctly you want to show the open customers for the last day of the month (which applies also to higher levels - meaning last day of the quarter or the year).
If this is the case, then you have to modify your formula as follows:
Total Open Customers = CALCULATE( COUNT('IA Dim_Customer'[CustomerKey]),FILTER('IA Dim_Customer', 'IA Dim_Customer'[Status] = "Open" && 'IA Dim_Customer'[ValidFrom].[Date] <= max('IA Dim_Date'[FullDate]) && 'IA Dim_Customer'[ValidTo].[Date] >= max('IA Dim_Date'[FullDate])))
That means positioning max(FullDate) - end of each interval - between the validity interval, between Valid From and Valid To.
Regards,
ElenaN
hi, @Anonymous
You could try to refer to this post:
Best Regards,
Lin
Hi,
Share the link from where i can download your PBI file.
Hello,
If i understand correctly you want to show the open customers for the last day of the month (which applies also to higher levels - meaning last day of the quarter or the year).
If this is the case, then you have to modify your formula as follows:
Total Open Customers = CALCULATE( COUNT('IA Dim_Customer'[CustomerKey]),FILTER('IA Dim_Customer', 'IA Dim_Customer'[Status] = "Open" && 'IA Dim_Customer'[ValidFrom].[Date] <= max('IA Dim_Date'[FullDate]) && 'IA Dim_Customer'[ValidTo].[Date] >= max('IA Dim_Date'[FullDate])))
That means positioning max(FullDate) - end of each interval - between the validity interval, between Valid From and Valid To.
Regards,
ElenaN
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 |
---|---|
112 | |
97 | |
83 | |
67 | |
61 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |