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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Targets in DAX using a bar chart

I have some data about store sales %. I want to compare the actual sales percentages with the targets. The targets are generated as part of forecasts and no data exists just percentages. The actuals are caluclated and I wanted to load the targets as a separate table. I have tried the following

1) Adding a table using enter data - However, when comparing on a bar chart this column aggregates and I have placed a Don't Summarise 
2) Using "addcolumns" in dax  I get the following error multiple columns cannot be converted to a scalar value 

Target =
ADDCOLUMNS(SWITCH(Location[State],
"NSW", 0.20,
"VIC", 0.50,
"SA", 0.90,
"WA", 0.45,
"TAS", 0.55))
 
StateTargetActual
NSW20% 
VIC50% 
SA90% 
WA45% 
TAS55% 

 

Any suggestions to go about this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

First method, after creating the table, you will need to create a relationship between the fact table and new table by using [State] column.

1.jpg2.jpg

 

Best Regards,

Jay

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

First method, after creating the table, you will need to create a relationship between the fact table and new table by using [State] column.

1.jpg2.jpg

 

Best Regards,

Jay

amitchandak
Super User
Super User

@Anonymous , You should try like

 

ADDCOLUMNS(distinct(Location[State]), "Target" ,SWITCH(Location[State],
"NSW", 0.20,
"VIC", 0.50,
"SA", 0.90,
"WA", 0.45,
"TAS", 0.55))

 

 

Here the sales and target should join with the common state table and then analyze them together with help from common table

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.