Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
MbProg
Helper II
Helper II

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?

1 ACCEPTED SOLUTION

@MbProg

 

You can use SAMEPERIODLASTYEAR in a measure as

sameMonLastYr = CALCULATE(SUM('Table'[sales]),SAMEPERIODLASTYEAR('Table'[DATE])) 

Capture.PNG

View solution in original post

9 REPLIES 9
ankitpatira
Community Champion
Community 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.

 

Capture.PNG

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:

Unbenannt.png

Do you a way to realize that?

@MbProg

 

You can use SAMEPERIODLASTYEAR in a measure as

sameMonLastYr = CALCULATE(SUM('Table'[sales]),SAMEPERIODLASTYEAR('Table'[DATE])) 

Capture.PNG

Hi @Eric_Zhang,

I tried the sample you gave as a measure and as a new column, but it does not give any value. I have even created a simple data tabel in Excel and imported it in a new Power BI, but I still don't get any values. The sample data looks like this:

Date  Value

001.01.2015
001.02.2015
001.03.2015
7901.04.2015
001.05.2015
001.06.2015
50001.07.2015
001.08.2015
001.09.2015
001.10.2015
001.11.2015
001.12.2015
6430501.01.2014
001.02.2014
001.03.2014
222201.04.2014
2350001.05.2014
392,801.06.2014
001.07.2014
001.08.2014
001.09.2014
200001.10.2014
2866401.11.2014
001.12.2014

But when I enter the following code, I get no data:

New Column: WertMonLastYr = CALCULATE(SUM('Tabelle1'[Column1]);SAMEPERIODLASTYEAR('Tabelle1'[Column2]))

Measure: sameMonLastYr = CALCULATE(SUM('Tabelle1'[Column1]);SAMEPERIODLASTYEAR('Tabelle1'[Column2])) 

I tried to enter the sameMonLastYr in the "Column Series" in the Combo charts, but I still get no value for it (it stays the same).

What am I doing wrong?

@MbProg

 

Enter the sameMonLastYr in the "column values"in the Combo charts, not in the "Column Series" and it should work.

Capture.PNG

 

Check the attached pbix.

@Eric_Zhang I see that you are using Column Hierarchie for the date column. That was exactly the difference between mine and yours and why I was getting an error. Can you tell me what the Hierarchie is doing? And I noticed that the drilldown button disappears when you use hierarchie.

@MbProg

Is that working in your case?

The hierarchy stops drilling down, if you don't want drill down your data from year->quarter->month->day.

@Eric_Zhang Is it possible to drill down the hierarchie of date? I don't find any possiblity to do this. And can you tell me what the hierachie is doing and when to use it?

@MbProg

 

It depends on your requirement. Check Visual hierarchies and drill-down behavior.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.