Forum Discussion
Loading data in Combo Charts
I have a data table with the following structure and data:
Fields: Customer - Year- Income of year - IncomeJanaury - IncomeFebruary- IncomeMarch-....- IncomeDecember
Data:
Some Company X - 2012 - 234 - 12 -23 - 122 - ....- 34
Some Company X - 2013 - 448 - 23 - 12 - 492- ...- 93
Some Company Y - 2012 - 234 - 12 - 23 - 312- .... - 32
Now I want to show this data with Combo Charts so that I can draw a chart for a customer with Y-Axis for the incomes and on the X-Axis for the years. Is that possible in Power BI due to the face that the table has the mentioned structure? Is there a way?
You can use SAMEPERIODLASTYEAR in a measure as
sameMonLastYr = CALCULATE(SUM('Table'[sales]),SAMEPERIODLASTYEAR('Table'[DATE]))
9 Replies
- ankitpatiraCommunity Champion
MbProg all you have to do is go to query editor, select all income columns and then click Unpivot columns as shown below. Then use years column for x-axis and unpivoted Values column for y-axis.
- MbProgHelper II
Thanks ankitpatira, this helped me a lot. Now I am able to show the incomes of the months as columns in the Combo Charts. Furthermore I am looking for the following function, but I don't know if it is possible: I want to show the income of every month as a column as I am doing right now, but I also want to show next to each income column a specific month of the year another column which shows the income the same month of the previous year. That means something like this pic:
Do you a way to realize that?
- Eric_ZhangMicrosoft Employee
You can use SAMEPERIODLASTYEAR in a measure as
sameMonLastYr = CALCULATE(SUM('Table'[sales]),SAMEPERIODLASTYEAR('Table'[DATE]))