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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
kurisu434
Regular Visitor

Line and stacked column chart help

Hello all. I'm trying to create a line and stacked column chart and am having issues getting it working correctly. The chart needs to show a running total, broken down by week,  and display the totals for said week. This part I have working via the measure below. The second part is that I need to have it color coded based on a yes/no column. When I apply this column to 'column series', I get incorrect numbers.

 

Client Count =
CALCULATE(
DISTINCTCOUNT('MyTable'[ClientID]),
FILTER(ALL('MyTable'),
'MyTable'[Date Submitted] <= MAX('MyTable'[Date Submitted])))

 

For example, My last column shows 7458 as the total. When I add the yes/no column to column servies, I get a 50-50 split in the color, and the number reported for yes is 7458, and for no the number shown is 7458 as well.

 

I have several other line and stacked column charts where the color coding is working fine and two that arent, both using a running total so I assume that's where the problem is, but I haven't been able to figure out how to correct it.

 

I'm fairly new to Power BI as I'm coming from Tableau, where I had this working fine. Unfortunately, I need to get it all moved to PBI and am still trying to figure it out. Any help would be appreciated.

9 REPLIES 9
dax
Community Support
Community Support

Hi @kurisu434 ,

I am not clear about your problem, if possible could you please inform me more detailed information(such as your expected output and your sample data)? Then I will help you more correctly.

Please do mask sensitive data before uploading.

Thanks for your understanding and support.
Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

There's too much private data to realistically mask it all. Instead, I've created sample data from scratch and replicate the problem I'm having. At the link below you'll find the data in an Excel file and a PBIX with two sheets. One showing the data with running total, no column series. The second showing running total, with the 'expedited' column. Total data is 100 items, and in the second page, it shows 100 for yes and 100 for no. Same problem I'm having with the real data.

 

https://1drv.ms/u/s!Aozhmk5k4dmzgY8b6i_L1p10AO10hA?e=YZVs5m

Hi @kurisu434 ,

 

check this out.

PBIX

Regards,

Marcus

Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


That looks much better. I tried making the same changes to my file and I'm not sure if I'm doing something wrong or am missing a step. I create a new table, selected mark as date table, created the week column. Then swapped out mytable.week to calendar.week. Then created a new column, called running total using mytable.client number and calendar.date (since I'm still using the other running total column). It's now showing the right number (no longer a 50-50 split) but it's showing the same numbers for every week.

 

Also, is there a way to change how the week is represented? Instead of 2020-4, have it state the day of the week (e.g. 2020-01-20, 2020-01-13, 2020-01-06, etc.)?

Hi @kurisu434 ,

 

use this

Week = 'Calendar'[Date] - WEEKDAY('Calendar'[Date],2)+1

I added a relative filter to limit the date range.

Filter_20200122png.png

 

Regards,

Marcus

Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


That did it, but uncovered a different issue. Compared to my original file, the dates are wrong. My data has items starting at 17-04-24 through 19-09-30, however the chart now says the last item is from December.

 

Added screenshot with names blurred out. It should show running total for all columns, and Nov and Dec should say Aug and Sept, the real dates the data is from.

 

 

Also, any thoughts on why the columns are showing the total values instead of a running total like the sample pbix?

Hi @kurisu434 ,

 

a date table always includes an entire year.

You must explicitly filter the date table for the desired period.

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


So I used your sample, where it was working with stacked columns and a running total, and simply added the real data and swapped out the column values and column series (w/o editing or removing any of your changes) and I still have the issue where all columns display the same total, instead of a running total for that week.

Hi @kurisu434 ,

 

the problem is that ALL ignores all filters on MyTable.

Use a data table to ignore the filter only on the date.

 

Regards,

Marcus

Dortmund - Germany
If I answered your question, please mark my post as solution, this will also help others.
Please give Kudos for support. 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.