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
netpharma
Frequent Visitor

Combo chart with target line

Hi community,

 

I have my sales data set in 2 tables:

Table 1: sale id, date, customer id, supplier id

Table 2: sale id, item id, price, discount, currency

 

From the above tables i calculate the sales amount and display it on a combo chart month by month. This works well so far.

 

in a third table i have the yearly targets by month:

Table 3: date, target

FOr each month of 2019, i have set a target. I want to display those targets month by month on the combo chart displaying sales. Note that the sales and targets tables are not linked. So the expected outcome will be as per the attached image. 

 

targets.png

 

 

Any help will be much appreciated. 

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@netpharma,

Please create a measure in your sales table using DAX below and then drag the measure to Line values of your combo chart.

Measure = CALCULATE(SUM('Table 3'[target]),FILTER('Table 3',MONTH('Table 3'[date])=MONTH(MAX('Table 1'[date]))))



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

@netpharma,

Please create a measure in your sales table using DAX below and then drag the measure to Line values of your combo chart.

Measure = CALCULATE(SUM('Table 3'[target]),FILTER('Table 3',MONTH('Table 3'[date])=MONTH(MAX('Table 1'[date]))))



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Is it work for 3 target? So ,it will be 3 lines in same chart!

Thank you. Worked like a charm

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.