Forum Discussion

antc's avatar
antc
Frequent Visitor
7 years ago

How to create a a custom Goal chart

Hi all,

 

Very new to Power BI and trying to show some custom goals.

 

I have entities (tables) from Dynamics 365 Account, Goals (custom), Model (custom), Opportunity Product, Opportunity

 

Goals (custom entity, 1:N to Model, 1: N to Account, goal(int), Date)

Model (custom entity,1:N to Product)

 

Opportunity Product (extra fields(columns), account lookup)

 

The rationale is to show the Models (20) by Account by month and have the Goal show as a line or dot on the same chart. I also need ability to rollup from Account -> Parent Account -> Territory -> Business Unit.

 

I have used Lookupvalue to add the Model, Est Close Date, Account Name and Territories to Opportunity Product Table for creating the base data for the chart.

 

I have attempted various processes to show the Goals however nothing seems to work. My latest attempt was to create a merge query between Opportunity Product and Goal. I created new Custom Columns to convert dates to MM/YYYY which worked well and joined on Account_Value, Model_Value and Date. I then planned to use the index key to pull in the Goal for each record and display it using Max or Average. The issue here however is that it seems to take forever with 16000 records which suggests my method may be flawed and also I need to display all Models whether they have an Opportunity Product or not so with this method wouldn't see the Model or Goal if no Record exists for that month for that Account.

 

Here is a very basic look at the core tables that need to come together.

 

Any ideas on how to achieve this?

4 Replies

  • antc's avatar
    antc
    Frequent Visitor

    This has worked to the point where I'm able to see a column with quantity of Opportunity Products and goals however still have issues with this method:

     

    Refresh takes a long time to get data.

    Can't see Models where there isn't any for an Account by month.

  • Anonymous's avatar
    Anonymous
    Not applicable

    antc,

    Do you also have an Account table? I notice that you have different Account values in Goal table and Opportunity Product table. Also where do these fields (Est Close Date, Territory, Business Unit) come from? 

    Please share sample data of your tables and post expected result following the guide in this thread

    Regards,
    Lydia

    • antc's avatar
      antc
      Frequent Visitor

      Hi Lydia,

       

      Here is the actual tables where I have done some lookups to append some columns to help.

       

      I have tried to create relationships. Having the Target as a column on Opportunity Products is a fail as I was using average for when target is listed more than once for the same segment and company. The problem with that is once you start rolling up it doesn't roll up. Where I was refering to Model it's actualy Segment.

       

      Idea is to have this which would be Columns as total of Opportunity Products (quantity) by Segment, Account and Date.

      Ant the Line would be Target Total from Target by Segment, Account and Date. The Target table contains a record for every Month, Account and Segment. So for the first column where Target is 1 if the filter was for 3 months we would expect a Target of 3 and the Column to be 12 if there was no variances. 

       

       

      Here are my current tables the scrubbed out sections are all the same prefix

       

       

       

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        antc

        Could you please share the sample data of these tables in a excel file so that I can copy? Or you can share PBIX file via Private Message.

        Regards,
        Lydia