|

Two Parts: Yikes! and Dates in Power BI

Yesterday, after I finished posting my blog post, I did my usual evening pull down of data and review of the latest results. And yikes! Graphically, it looked like the cases jumped so I’m going to briefly talk about those before heading to my original topic: dates in power BI. That second topic will be very brief also.

Okay, first, I had a concern about the dimensions of my chart and whether it was distorting the analysis of what I was seeing so I did a few different dimensions of the same graph.

A. This is the original layout that I’ve been using.

B. Here’s two versions where I either squished the original to be more vertical or more horizontal.

C. This is the original version squished to be more horizontal.

It looks like squishing the chart vertically a la the first chart in section B makes the surge more dramatic while squishing horizontally like that in section C dampens the drama, even though the surge is still apparent. I think my original chart isn’t distorting the rise – the Midwest is suffering a rampant infection in the community.

Here’s a comparison with yesterday’s chart:

A. Original 11.13.2020 chart

B. Yesterday’s chart 11.12.2020

I didn’t change the dimensions on the 11/13/2020 chart (on the left in section A); Power BI did the adjusting to fit the single day surge onto the chart. The surge was dramatic enough that my eyes caught the adjustment when the screen updated and I just went “whoa!”.

So, after I caught this dramatic surge late at night, maybe around 11 p.m., I spent the rest of the night and morning previewing the news on the coronavirus – I was up until roughly 3 a.m. in the morning. The news are mostly dire. At this point, I think masks are probably going to be useless and the virus is just going to rip through our communities because hospitals are about tapped out and the people are showing no will to take the extreme steps necessary to reduce the virus’ opportunities to infect. The best thing to do if you are concerned is to stay home (if you can) and have no contact whatsoever with people because you won’t know who made contact with an infected person and thus could be bringing the virus to you. This self-isolation could go on for months.

Here’s a more detailed graphic on the four regions on 11/13/2020:

In the Midwest, it’s Illinois, followed by Michigan and then Wisconsin. The top three for the Northeast are: New York, Pennsylvania and New Jersey. The South’s top three are: Texas, Florida and Tennessee. Finally, in the West, California leads the pack, followed by Colorado and Arizona.


Now, for a few things I’ve learned about dates in Power BI.

One thing you may encounter when you pull data from elsewhere, you may pull in a date and time that is not reflective of your local area because the server or site is sitting in a different time zone. Yes, you can get strange dates and times that may confuse your readers / users. When I had previously encountered this issue, I had to “program”, I think using M language, to add a column holding the “refresh” date and specifying the timezone.

I added this line in the editor
#”Added Refresh Date” = Table.AddColumn(#”1″, “Refresh Date”,
each DateTimeZone.SwitchZone(DateTimeZone.LocalNow(),-5,0), type datetimezone)

You will have to play around to set the date and time for your environment.


Oftentimes I will use a “card” rather than a chart to display a single number, usually a count or summed number for the latest date. In my Power BI file pulling and tracking the coronavirus, I usually want a figure for the most recent day and I find that I oftentimes will have to filter using a relative date filter of within the last two days. That seems to work the best but it does have some quirks. In my chart, if I update in the middle of the day, the numbers will come in for two days, today and yesterday, but if I hold off until evening, then the chart or card

will pull in just today’s figures. This quirk probably depends on the timing of when you developed the file. I’ve had to play around with this filter until I got it working to suit my needs.


The last thing I noticed about dates in Power BI is that sometimes I’m given a choice on the date format: I can have regular date, or I can choose the year, or the month, or the day. And sometimes I don’t have any choice at all. I don’t really know why; I read that the capability to get the date hierarchy (year, month or day) is determined by how you set up “relationships”. Right now I don’t know anything about how that works. Last night I wanted to get average number of daily case infections for each month but I could not get the date hierarchy for month. I was not given

any choice. I had to resort to adding a new column in the table to hold the Month([Date]), where [Date] was the field name, and make sure that column was set to a whole number or integer.

Similar Posts