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 DAX formula that Counts all active items taking into consideration start and finish dates, for a range of different dates set out by a slicer.
Now I need another one that will accumulate the previous Count within a range of dates, for each one of them dates.
So, for instance, a Matrix
1/1/2020, active items = 5, accumulated active items = 5
2/1/2020, active items = 5, accumulated active items = 10 (are the exact same as on the previous day)
3/1/2020, active items = 6, accumulated active items = 16 (are the exact same as on the previous day + 1)
4/1/2020, active items = 4, accumulated active items = 20 (2 of them are not active any more)
The data model I'm working with, among other items, is as follows:
Table DATE
Column DATES (Active relationship with TRANSACTIONS[POSTING DATE])
Table ITEMS
Column ID (Active relationship with TRANSACTIONS[ITEM])
Column START DATE
Column FINISH DATE
Table TRANSACTIONS
Column POSTING DATE (Active relationship with DATE[DATES]) *date where the transaction was ever posted*
Column ITEM (Active relationship with ITEMS[ID])
Column TRANSACTION DATE **date where the transaction will actually take place**
My DAX formula that Counts the active items is as follows (works just fine):
Facundo
Hi @FStettler ,
Pls go through this article.
https://www.sqlbi.com/articles/computing-running-totals-in-dax/
Hi @harshnathani,
Thanks for the swift reply but it didn't help me out with my query.
I can't use measures as a filter expression. Also using the FILTER function to be able to use MAX is not working either.
I need to accumulate the same active items even though they've been taken into account in a previous day.
I'm working with room nights on holiday apartments, these are my active Items. Every apartment has its own start and end date of availability. I'm analyzing all room nights to sell within a range of transaction dates.
So for instance, following up on my own example above, from 1/1 to 3/1 I have 16 room nights to sell (5+5+6). Or from 3/1 to 4/1 I have 10 room nights to sell (4+6). Even though they might be related or not to the same active item, when another date is added to the range, that's another room night to sell and needs to be added up to the total accumulated figure.
That's the outcome I need the measure to return.
Thanks again.
Facundo
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
102 | |
87 | |
64 |