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.
Hi,
I have a table of accounts, which includes the account number, status (A=Active, C=Closed), account opening date and closing date (blank if still open).
Both of the date columns have an inactive relationship to a calendar[Date] field - inactive due to a previous relationship which would introduce ambiguity between other tables.
I am trying to create a simple visualisation which would result in showing the amount of active accounts at a given date, with an additional visualisation showing the amount opened and closed in the period - preferably monthly.
A simplified version of my table is shown below:
account_number | open_date | close_date | status | |||
1 | 01/12/2021 | 01/01/2023 | C | |||
2 | 01/12/2021 | A | ||||
3 | 01/03/2022 | A | ||||
4 | 01/03/2022 | 01/03/2023 | C | |||
5 | 01/06/2022 | A | ||||
6 | 01/12/2022 | A | ||||
7 | 01/03/2023 | 01/03/2023 | C | |||
8 | 01/06/2023 | 01/09/2023 | C | |||
9 | 01/09/2023 | A | ||||
10 | 01/12/2023 | A |
If displayed numerically I would expect the results to look similar to below:
Date | Running count of open accounts | Opened | Closed | |||
01/12/2021 | 2 | 2 | 0 | |||
01/03/2022 | 4 | 2 | 0 | |||
01/06/2022 | 5 | 1 | 0 | |||
01/09/2022 | 5 | 0 | 0 | |||
01/12/2022 | 6 | 1 | 0 | |||
01/03/2023 | 4 | 1 | 3 | |||
01/06/2023 | 5 | 1 | 0 | |||
01/09/2023 | 5 | 1 | 1 | |||
01/12/2023 | 6 | 1 | 0 |
I've tried a variety of measures with no success, so would appreciate some help.
Thanks in advance!
Solved! Go to Solution.
Hi @Abhilash_P , thanks so much for your quick response.
I had to make a couple of tweaks as the relationships had to stay inactive due to other connections, but all resolved now. Thanks so much for your help!
Hi @Abhilash_P , thanks so much for your quick response.
I had to make a couple of tweaks as the relationships had to stay inactive due to other connections, but all resolved now. Thanks so much for your help!
Hi @JohnM1985 ,
You can create calendar table using below dax
- Create Active relationship between calendar table date to open_date
- Create Incative relationship between calendar table date to close_date userrelationship dax to get count of closed accounts.
Create below measures
Regards
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 |
---|---|
105 | |
94 | |
75 | |
63 | |
62 |
User | Count |
---|---|
137 | |
105 | |
104 | |
80 | |
63 |