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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
sivarajan21
Post Prodigy
Post Prodigy

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 

1 ACCEPTED SOLUTION
7 REPLIES 7
Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

https://1drv.ms/u/s!AiUZ0Ws7G26Rh1sdoZSgBgCryq1c?e=wILm1o

Ahmedx
Super User
Super User

pls try this

Screen Capture #991.pngScreen Capture #992.png

Ahmedx
Super User
Super User

pls try this

Screen Capture #991.pngScreen Capture #992.png

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 

Hi @Ahmedx ,

 

Brilliant and spot on!

Thats the expected solution and I will accept this as a solution.

 

Kudos to your quick response.

 

Once again many thanks to you and the community!

Hi @Ahmedx ,

 

Apologise for the delay in response!

Brilliant, many thanks for wonderful solution.

Will get back on this after testing them😊

 

Thanks

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.