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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

How to add/manage goals

I have the following tables in my data model:

A calendar table

A sales table with 3 columns: Date, Client, Sales $ 

 

I want to add target sales goals for every month, so I created this target goals table: 

 

Capture5.PNG

 

I then made a relationship between this table and my calendar table. Also, I made a relationship between my sales table and my calendar table. However, this does not seem to allow me to use dates from my calendar table in conjunction with sales data from my sales table and goals from my goals table (it seems to be either, but not both). When I try to create a KPI using the OOTB visual, it ends up looking like this:

 

Capture6.PNG

 

 

I lined up the "Date" field from each of my 3 tables to try and troubleshoot 'Calendar' [Date]. 'Sales' [Date]. 'Goals' [Date], and you can see that 'Sales' [Date] in the middle of this table repeats itself. It seems like there is something wrong with the relationships, but I can't figure out what. I thought since I am using my calendar table as a bridge, and both my sales and goals tables are connected to it, I wouldn't have any problems but this is not the case. 

 

Capture67PNG.PNG

 

Any ideas why this might be happening and what I can do to fix? Is there a better way of setting goals?

6 REPLIES 6
Anonymous
Not applicable

Seems like a relationship issue since that date is repeating. Any chance you can upload a sample of what you are working with?

Anonymous
Not applicable

I tried recreating the issue, and wasn't able to exactly (in my report I only have one 'Date' field repeating), but I believe this may be close enough to troubleshoot. 

 

Capture9.PNG

 

Here are my tables in excel table format:

 

DateRevenue Target

1/1/2019$4,424,663
2/1/2019$5,125,841
3/1/2019$5,332,878
4/1/2019$6,421,102
5/1/2019$4,617,133
6/1/2019$4,011,744
7/1/2019$6,293,811
8/1/2019$6,869,289
9/1/2019$6,961,624
10/1/2019$5,892,707
11/1/2019$6,374,589
12/1/2019$5,871,117

 

Client DateMonthly Revenue

Client 11/31/20191365245
Client 22/28/20191258976
Client 33/31/2019463259
Client 41/31/20191452365
Client 52/28/2019142368
Client 63/31/20192365894

 

I can't post my entire calendar table, since I'll hit the character limit,  so here's a sample...

idDateIdDateLocal Date StringYearMonth NumberDayMonth Name (Long)MonthWeekdayWeekday (Short)Day of WeekQuarterQuarter (format)Day Of YearWeek NumberWeek Number (Format)

366201901011/1/2019‎1‎/‎1‎/‎2019201911JanuaryJanTuesdayTue21Q111W1
367201901021/2/2019‎1‎/‎2‎/‎2019201912JanuaryJanWednesdayWed31Q121W1
368201901031/3/2019‎1‎/‎3‎/‎2019201913JanuaryJanThursdayThu41Q131W1
369201901041/4/2019‎1‎/‎4‎/‎2019201914JanuaryJanFridayFri51Q141W1
370201901051/5/2019‎1‎/‎5‎/‎2019201915JanuaryJanSaturdaySat61Q151W1
371201901061/6/2019‎1‎/‎6‎/‎2019201916JanuaryJanSundaySun71Q161W1
372201901071/7/2019‎1‎/‎7‎/‎2019201917JanuaryJanMondayMon11Q172W2
373201901081/8/2019‎1‎/‎8‎/‎2019201918JanuaryJanTuesdayTue21Q182W2
374201901091/9/2019‎1‎/‎9‎/‎2019201919JanuaryJanWednesdayWed31Q192W2
375201901101/10/2019‎1‎/‎10‎/‎20192019110JanuaryJanThursdayThu41Q1102W2
376201901111/11/2019‎1‎/‎11‎/‎20192019111JanuaryJanFridayFri51Q1112W2
377201901121/12/2019‎1‎/‎12‎/‎20192019112JanuaryJanSaturdaySat61Q1122W2

 

Here are my relationships:

Capture8.PNG

 

Thank you!

 

Anonymous
Not applicable

The issue here is that your Target Sales is based on the 1st of the month, while your sales is based on the end of the month.  Not a problem if you granularity of your table stays at the month level, but when you go to the day level it will not make sense since only the last day of the month will have the Target Sales. So a few ways to fix this, the easiest to just add column ( or transform the current date column) in your target sales to the End of the month. Then you can use columns from your Calendar table for filters ( rows, columns, slicers, etc) with this data model:

Data Model.png

Easy, change to EOM.png

 

Of course this all assumes you just have a monthly sales figures and not daily figures. If you have daily sales figures you may want to allocate the monthly target over each day or may want to see a % of total monthly sales vs. target. Or any number of ways.  

 

The basic idea is that you need the granularity to match in your Sales and Target Tables to make sense. Then you only want to use columns from your Dimension table (in this case the calendar table) to filter those fact tables.

 

Hope that makes sense

Anonymous
Not applicable

That worked! You know, it's funny I thought of that, but dismissed it for some reason. 

 

The issue I'm now running into is the KPI Value shows up as (Blank) in the KPI indicator visual. I believe this is happening because I have goals for the whole year, but don't have sales values yet? When I filter the page on either Jan, Feb, Mar of 2019 (where I have recorded sales amounts) the visual works properly, but when I only have 2019 selected, the result is (Blank). Is there any way to fix this?

 

Capture10.PNGCapture11.PNG

Anonymous
Not applicable

If you change the following for the Total Target Sales it will be capped at the max of your sales:

Total Target Sales using EOM = 
VAR __SalesLastDate =CALCULATE( LASTDATE( FactSales[Date]), ALL( FactSales[Date]))
RETURN
CALCULATE(
    SUM( FactTarget[Revenue Target] ),
    FactTarget[Date] <= __SalesLastDate
)

Capping Target to Sales.png

Anonymous
Not applicable

Nick, this worked perfectly, thank you! And thank you for such quick replies! One last question on this, how would I go about doing the same thing, but for a YTD vs Total Year Goal?

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.