Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hello,
I'm trying to create a visual where I can see the total of Active sites based upon the selected date.
I have the following example table.
I don't just need a total, but a count of customers per month if they are between "siteActiveDate" and "siteInactiveDate"
If the "siteInactiveDate" is "-" it means the "end contractdate" is not known yet.
Thanks in advance
customerID customer siteActiveDate siteInactiveDate
| 9705542 | Customer 1 | 1/01/2017 | 1/05/2017 |
| 9732311 | Customer 2 | 2/01/2017 | - |
| 2075200 | Customer 3 | 3/01/2017 | - |
| 9675600 | Customer 4 | 4/01/2017 | - |
| 4037701 | Customer 5 | 5/01/2017 | - |
| 40500 | Customer 6 | 6/01/2017 | - |
| 5613800 | Customer 7 | 7/01/2017 | - |
| 1888800 | Customer 8 | 8/01/2017 | - |
| 9675398 | Customer 9 | 9/01/2017 | 1/09/2017 |
| 9675398 | Customer 10 | 10/01/2017 | - |
| 9675398 | Customer 11 | 11/01/2017 | - |
| 9705604 | Customer 12 | 12/01/2017 | - |
| 2075200 | Customer 13 | 13/01/2017 | - |
| 831701 | Customer 14 | 1/02/2017 | - |
| 831701 | Customer 15 | 2/02/2017 | 1/10/2017 |
| 2075200 | Customer 16 | 3/02/2017 | - |
| 2075200 | Customer 17 | 4/02/2017 | - |
| 9657072 | Customer 10050 | 5/02/2017 | 12/02/2018 |
Solved! Go to Solution.
Hi @DirkPuylaert,
Please check out the demo in the attachment.
1. Create a date table if you don't have one.
2. DO NOT establish any relationship.
3. Create a measure.
Measure =
CALCULATE (
COUNT ( Table1[customerID] ),
FILTER (
'Table1',
'Table1'[siteActiveDate] <= SELECTEDVALUE ( 'Calendar'[Date] )
&& IF (
ISBLANK ( 'Table1'[siteInactiveDate] ),
DATE ( 9999, 12, 31 ),
'Table1'[siteInactiveDate]
)
>= SELECTEDVALUE ( 'Calendar'[Date] )
)
)
Best Regards,
Dale
Hi Dirk,
Please refer to the snapshot below.
Best Regards,
Dale
Hi @DirkPuylaert,
Please check out the demo in the attachment.
1. Create a date table if you don't have one.
2. DO NOT establish any relationship.
3. Create a measure.
Measure =
CALCULATE (
COUNT ( Table1[customerID] ),
FILTER (
'Table1',
'Table1'[siteActiveDate] <= SELECTEDVALUE ( 'Calendar'[Date] )
&& IF (
ISBLANK ( 'Table1'[siteInactiveDate] ),
DATE ( 9999, 12, 31 ),
'Table1'[siteInactiveDate]
)
>= SELECTEDVALUE ( 'Calendar'[Date] )
)
)
Best Regards,
Dale
Hello Dale,
That already works for some part, thanks a lot.
Now how can I have a visual like this?
Thanks,
Dirk
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 44 | |
| 42 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 72 | |
| 66 | |
| 33 | |
| 32 | |
| 31 |