简体   繁体   中英

Change SQL table design for Power BI dataset

I have a SQL table in the following format that I would like to use as a dataset in PowerBi:

在此处输入图片说明

I am trying to convert it into a condensed table like this:

在此处输入图片说明

Does anyone know how to go about this whether it is as a SQL script or in Power BI?

In the query editor, select all of the month columns ( Jan - Dec ) and choose Unpivot Columns under the Transform tab.

Once it's unpivoted, just filter out the zeros.

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