简体   繁体   中英

Power BI Data Transformation for visualizing Line Chart

I have a scenario which needs some guidance. I have a table of data contents as shown in the image.

[![enter image description here][1]][1]

The column-names 0,1,2,3 onwards indicate the count of impacted people, 0 being the first day of count. Days from Day 1, Cases row: Number of days since the geo-location passed 200 cases. Deaths row: Number of days since the geo-location passed 10 deaths.

I am trying to plot a line graph as where it will showcase the gradual growth of cases/deaths as per time. The count provided in the data is cumulative. For Example:

Afghanistan - Cases - 235 on 0th day Afghanistan - Cases - 269 on 1 day Afghanistan - Cases - 270 on 2 day Afghanistan - Cases - 299 on 3 day

Like this the count goes on and for each country. I am not having any particular parameter for time. As said, 0 is the starting day...and the count goes onwards. My desired output should be something like

[![enter image description here][2]][2]

As shown in the output, X axis is for time parameter and Y axis for count. I have tried to transform the columns but that did not work. I also tried to create a new column for time parameter, but then it was not able to link back to the counts of cases/deaths per country.

Can anyone provide any guidance on how to get to the desired visualization? [1]: https://i.stack.imgur.com/vnaRN.png [2]: https://i.stack.imgur.com/pLa8I.png

you can unpivot the columns 0, 1, 2, 3.... in power query and then use that column as x -axis the values as values and country column as legend.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM