Forum Discussion
Count items in a given datetime interval across several days
Hi again v-huizhn-msft
I've created a measure which returns the perfect answer given we provide the agreementID in the visualization.
In the new .pbix file on the report named "New test 19.04" ive created both a matrix and graph that displays the correct number of agreements for each hour and day, seems perfect right?
Problem is that you dont always want to display all the agreementID's in the visualization, the line graph looks TERRIBLE with all the ID's visible. When removing the agreementID the visualisations don't work anymore. Logical.. but i cant figure out how to fix it :(
https://www.dropbox.com/s/oe5xvz9voamr0l5/Demo.pbix?dl=0
The measures
#Agreements works if AgreementID in graph = if( min(factReservations1rowperday[DateFrom]) = [MinDateCalendar]; [#Agreements Startdate]; if( MAX(factReservations1rowperday[Date To]) = [MaxDateCalendar]; [#Agreements End date]; [#Agreements] ) )
Helping measures:
#Agreements Startdate = CALCULATE([#Agreements];FILTER(factReservations1rowperday;factReservations1rowperday[Time from]<='dimTime/Clock'[Maxtime]))
#Agreements End date = CALCULATE([#Agreements];FILTER(factReservations1rowperday;factReservations1rowperday[Time to]>'dimTime/Clock'[MinTime]))
Hi fenixen,
Congratulations. You have resolved your issue. Thanks for your sharing solution, please mark your reply as answer, which will help others to find workaround easily.
Thanks,
Angelia
- fenixen9 years ago
Advocate II
Well I wish I had solved it.. problem is that it doesn't work when i remove the AgreementID from the matrix or the graph.
As you can see the graph looks terrible, the customer cannot use it with agreementID on the legend :(
Really annoying that I can't solve this.. I've seen so much magic in dax, I would think it should be solvable :)