Forum Discussion

thebaldkappa's avatar
thebaldkappa
Regular Visitor
9 years ago

Calculate Sum Weirdness

Hi guys,

 

I'm very new to Power BI and would like to get some help.

 

I have linked two Excel tables in Power BI ('Growth Target') and ('Sales') with sample preview below.

 

 

Growth Target

 

Sales

I want to create a YTD Target =  LYTD Sales + Last Month Growth Target + MTD Growth Target

 

The MTD Growth Target measure works just fine. The measure that I use for Last Month Growth Target is

 

Last Month Growth Target = calculate(sum('Growth Target'[Monthly Growth Target]),datesbetween('Growth Target'[Months],date(2017,07,01),EOMONTH(today()-1,-1)))

 

However this measure shows weird behaviour because when I bring them together using the Sales Table, I will get the Total of $50 Last Month Growth Target being applied to non-existing Project Codes (A-012 and A-013). What have I done wrong? Please help.

 

Weird

 

 

 

 

2 Replies

  • Hey,

     

    What do you mean by linked, did you create a relationship with an additional table?

     

    I would be really helpful if you share a pbix by sharing a link to this pbix file, ideally pointing to the file on onedrive or dropbox.

     

    Regards

    Tom

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi thebaldkappa,

     

    It seems you created a wrong relationship. But I can't find more without the model. Could you please provide your PBIX file? You can replace your data with dummy data. 

     

    Best Regards!

    Dale