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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mflaursen
Regular Visitor

Custom targets in column chart

I am trying to make a clustered bar chart. Two columns for each month. One column is target, the other is actual value. 

 

The actual values come from a data source consisting of a column of processes. I am summing the number of times a specific process is in the column. This combined with the date column from that data source (all dates from 2018), yields a nice bar chart like this:

image.png

 

I have then made an excel sheet with target values like this:

image.png

If I make a column chart of this I get:

image.png

 

It still looks correct. Now, if I combine the two data sources in a stacked column chart I get this:

image.png

Each column of the actual value is now the sum of all the values. If I choose average instead of sum, I get 12 identical bars with the average value etc. The visual does not have to be a clustered bar chart, but I get the same result in a line/column chart.

 

How to fix?

3 REPLIES 3
Anonymous
Not applicable

I think you don't use a date table, which is why the measure is showing the total of all values, instead of the value per month.

If you don't use a date table yet, you should try it. It is very handy when filtering multiple columns from different tables.

Here is the DAX formula to create such date table (Model > new table):

 

DateTable = ADDCOLUMNS ( CALENDAR (DATE(2001,1,1), DATE(2020,12,31)), "DateAsInteger", FORMAT ( [Date], "YYYYMMDD" ), "Year", YEAR ( [Date] ), "MonthNo", FORMAT ( [Date], "MM" ), "YearMonthNo", FORMAT ( [Date], "YYYY/MM" ), "YearMonth", FORMAT ( [Date], "YYYY/mmm" ), "MonthShort", FORMAT ( [Date], "mmm" ), "MonthLong", FORMAT ( [Date], "MMMM" ), "WeekNo", WEEKDAY ( [Date] ), "WeekDay", FORMAT ( [Date], "dddd" ), "WeekDayShort", FORMAT ( [Date], "ddd" ), "Quarter", "Q" & FORMAT ( [Date], "Q" ), "YearQuarter", FORMAT ( [Date], "YYYY" ) & "/Q" & FORMAT ( [Date], "Q" ))

Then make the relationships between the date table and the relevant tables. When you add the month from the date table, it should show the correct values.

Please let me know if this works.

Still does not seem to work 😞 I have connected the "Date" column to the "Lotmovementdate" in the lotmovmentdata and the "Target date" in the Goals table.

 

image.png

image.png

Hi @mflaursen,

 

I'd like to suggest you change cross filter direction to 'both' for these tables and try again, it seems like power bi can't use current relationship to analysis and gripping your records.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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