Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I have a very complex problem. I'm new to dax but I'm not sure it can solve this.
I have a table of id, start date and end date.
Now I need to create snapshot table. I created new date table using function calendarauto. But now I need to calculate column or a measure like so:
If date row from date table is between open and closed date, it will count as 1, otherwise 0.
For example: id 1, should be calculated for january, february, march and april, for id 2 only in january, and so on...
In chart (or table) values should be:
January: 2,
February: 5,
March: 9,
April: 7
I hope I explained it well. Thanks for any help.
Solved! Go to Solution.
Because you didn't provide data in a format that I can copy and paste and I don't feel like retyping all of your data, I probably shouldn't attempt to answer this without testing. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
But, here goes. In your Calendar table, create a new column like this:
Column = COUNTROWS(FILTER(ALL(Incidents),Incidents[Open Date]<=[Date]&& Incidents[Close Date]>=[Date]))
I'm fairly sure that is correct. It feels correct.
Check out my Open Tickets Quick Measure. Just learned how to elegantly solve these types of problems thanks to @Phil_Seamark's excellent new book, Beginning DAX with Power BI: The SQL Pro’s Guide to Better Business Intelligence. Fantastic resource. Here is the link to the Quick Measure:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Open-Tickets/m-p/409364#M147
Because you didn't provide data in a format that I can copy and paste and I don't feel like retyping all of your data, I probably shouldn't attempt to answer this without testing. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
But, here goes. In your Calendar table, create a new column like this:
Column = COUNTROWS(FILTER(ALL(Incidents),Incidents[Open Date]<=[Date]&& Incidents[Close Date]>=[Date]))
I'm fairly sure that is correct. It feels correct.
User | Count |
---|---|
140 | |
113 | |
104 | |
76 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |