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 graph which displays appointments booked by time:
The X Axis is at 15 minute intervals. This is my data model, the table v_15MinuteIntervals is a dimension table with a row for every 15 minutes in a day:I have my graph axis defined like this:
What I want to do is have my X axis start and end at the time when appointments start and end, so rather than going for a 24 hour period it would start around 6 AM and end around 2:15 PM. In the X-Axis properties I can see we can define Start and End properties. I can't seem to set these as a value from my data set though. I can only select a date, but I need these to be dynamic.
Is there anyway to set the Start and End properties on the X-Axis to be a value from my data set?
Solved! Go to Solution.
Ahh I see,
There are many ways you could do this. Here is one that should work.
Note ALLSELECTED could be changed to ALL to give absolute min/max times with data:
Appointment Count = VAR MinTimeWithData = CALCULATE ( MIN ( v_Apointments[Appointment Time] ), ALLSELECTED () ) VAR MaxTimeWithData = CALCULATE ( MAX ( v_Apointments[Appointment Time] ), ALLSELECTED () ) VAR MinTimeFiltered = MIN ( v_15MinuteIntervals[15MinInterval] ) VAR MaxTimeFiltered = MAX ( v_15MinuteIntervals[15MinInterval] ) RETURN COUNT ( v_Appointments[Appointment] ) + IF ( MinTimeFiltered <= MaxTimeWithData && MaxTimeFiltered >= MinTimeWithData, 0 )
Regards,
Owen
Update:
I have created two measures, one with the first time of the appointments, one with the last time of the appointments. Is there a way I can make the X-Axis stay within these parameters?
Appointments Start At = Min(v_Appointments[Appointment Time])
Appointments End At = MAX(v_Appointments[Appointment Time])
Normally the x-axis will adjust automatically to exclude ranges
It looks like your Appointment Count measure is returning zero instead of BLANK over certain ranges. Ideally, you should define Appointment Count so that it returns BLANK rather than zero. Is this possible in your situation?
Normally this happens automatically with measures using COUNTROWS or DISTINCTCOUNT, but your measure may be more complex. You can always write the measure to replace zero with BLANK, or you could incorporate the bounds you described above into the measure definition.
Could you post the definition of Appointment Count?
Regards,
Owen
Hi Owen,
Yes, you are right, I have made it return 0 rather than blank:
Appointment Count = Count(v_Appointments[Appointment]) + 0
I needed the graph to dip down to 0 rather than blank when there is no appointments. I guess the ideal situation is if I can return blank if the time is before or after the first and last appointment times.
Ahh I see,
There are many ways you could do this. Here is one that should work.
Note ALLSELECTED could be changed to ALL to give absolute min/max times with data:
Appointment Count = VAR MinTimeWithData = CALCULATE ( MIN ( v_Apointments[Appointment Time] ), ALLSELECTED () ) VAR MaxTimeWithData = CALCULATE ( MAX ( v_Apointments[Appointment Time] ), ALLSELECTED () ) VAR MinTimeFiltered = MIN ( v_15MinuteIntervals[15MinInterval] ) VAR MaxTimeFiltered = MAX ( v_15MinuteIntervals[15MinInterval] ) RETURN COUNT ( v_Appointments[Appointment] ) + IF ( MinTimeFiltered <= MaxTimeWithData && MaxTimeFiltered >= MinTimeWithData, 0 )
Regards,
Owen
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |