Forum Discussion

sivarajan21's avatar
sivarajan21
Post Prodigy
3 years ago
Solved

Create calculated columns by summing values in another table

Hi,

 

I have been working on this for almost a week now but couldn't figure out.

Below is my sample dataset. 

Missing Dates table

DateDB Name - Points id
Apr 2,2022northyorcc-1010
Mar 2,2022inse-1017

 

Target table

DBName-Point_idTarget typeValue TypeValue
northyorcc-10100Value_10-11
northyorcc-10100Value_11-545
inse-10171Value_011
inse-10170Value_0265
northyorcc-10101Value_036
northyorcc-10102Value_039
northyorcc-10102Value_03-3
inse-10171Value_0210
northyorcc-10103Value_0312
inse-10172Value_0210
inse-10173Value_0210

 

I am confused with how to create a calculated column in missing dates table. I tried many measures but this confuses me.

I need to create a calculated column called 'Target Units' in Missing Dates table that sums the Target table 'Value' column if their target type is 0 & it corresponds to their DBName_Point_id.

 

Similarly, calculated column called 'Target Cost' in Missing Dates table that sums the Target table 'Value' column if their target type is 1.

Both the calculated columns are created for their corresponding points id

 

Expected output would look something like below:

DateDB Name - Points idTarget unitsTarget cost
Apr 2,2022northyorcc-1010-5566
Mar 2,2022inse-10176511

 

PFA sample file here

Calculated column referencing other tables.pbix

 

Thanks in advance.

 

Ahmedx grantsamborn Greg_Deckler 

7 Replies

    • sivarajan21's avatar
      sivarajan21
      Post Prodigy

      Hi Ahmedx ,

       

      Apologise for the delay in response!

      Brilliant, many thanks for wonderful solution.

      Will get back on this after testing them😊

       

      Thanks

    • sivarajan21's avatar
      sivarajan21
      Post Prodigy

      Hi Ahmedx ,

       

      Many thanks for your patience

      Today I had a chance to test this and found the below:

      The solution is perfect and it works great. But I need a slight change with a way this measure sums the Target value.

      I have this below dataset after testing:

       

      Target table:

      DBName-Point_IdTargetTypeValue TypeValueSource_NumSource
      INSE-7920Value_12659.59997564Budget

       

      Missing Dates table:

      DateDB Name - Points IdunitTarget
      31-Dec-26INSE-79215020.32397
      30-Dec-26INSE-79215020.32397
      29-Dec-26INSE-79215020.32397

       

      Month Lookup

      Value Type Month 
      Value_01January
      Value_02February
      Value_03March
      Value_04April
      Value_05May
      Value_06June
      Value_07July
      Value_08August
      Value_09September
      Value_10October
      Value_11November
      Value_12December

       

      This measure currently sums all the target value for their corresponding DBName_Point_id.But this measure should also sum target value corresponding to their target table Month(Value Type).

      The month in Date column should match corresponding month(Value Type) in Target table and get the value.

      I am confused how to modify this measure to include the filter condition target table Month(Value Type)

      as they don't have month name directly specified(ex:Value_01 for January,Value_02 for February etc.). I had created the Month lookup table and tried but didn't help.

       

      The expected output:

      DateDB Name - Points IdunitTarget
      31-Dec-26INSE-792659.5999756
      30-Dec-26INSE-792659.5999756
      29-Dec-26INSE-792659.5999756

       

      This above 659.599 is the corresponding target value of INSE-792 for month of December(Value_Type 12).

       

      Can you please guide me on this ?

       

      PFA sample file in below link:

      Calculated column referencing other tables_total.pbix

       

      Please let me know if you need further info.

      Thanks in advance

      Ahmedx grantsamborn Greg_Deckler