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 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.
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 |
---|---|
104 | |
95 | |
80 | |
67 | |
62 |
User | Count |
---|---|
147 | |
109 | |
107 | |
85 | |
63 |