
In Power BI there are several custom visuals available, such asĀ Elastacloud’s Calendar Visual, that show the density of events over time. However, if your data includes date ranges (start date with a different end date, such as task/project lists), visuals like these will only understand one of the two dates (whichever you’ve chosen for the data value) and none of the dates in between will be accounted for, making your data visualization incorrect.
You can, however, “expand” these date ranges or durations to create rows for all the dates including start, end and those in between. This way each date that’s part of the range is then graphed appropriately.
- Click “Edit queries” to open Power Query editor
- Make sure your date columns are date (not date/time) format
- Create a custom column
- Change the name to “Date” and paste the following after the equals (“=”) sign:
{ Number.From([EventDate])..Number.From([EndDate]) }
- Click OK
- Click the “diverging-arrow” icon next to “Date” and click “Expand to new rows”. Notice the addition of new rows.
- Change the column type to “Date”
- You may wish to delete your “start date” and “end date” columns but certainly don’t need to.
- Click “Close and Apply”
- Use your new “Date” column instead of “start date” or “end date” in your visualization pane values. Notice how more squares are filled in for dates that fell into ranges previously unaccounted for.
I’m Following the instructions, and do get dates, however, I do not get any new rows. What am I doing wrong?
Is it possible to break down also including hour?
So helpful, thank you
Hi, this is great! But i need it to work with minutes to, is this possible?
Did your find any solution? I am having same issue like you are searching for also
This is unbelievable! I’ve been pulling my hair trying to find this answer. Thank you a million times!
Hi, thanks for article. It was very helpful. However a whole number field I had was not divided into equal parts. Is there a way I can do this?
Ejo: I walked into this now, almost a year later. I’m quite noob with this but my solution is that before you expand, you substract the end date-start date, then add custom column 1 and divide this with the previous number.
You will get a number 0,00x…. on each row, then you can use this as a multiplier to multiply your budget, etc. numbers.