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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
CRN
Helper I
Helper I

Retrieving and spreading data from many side of a one-to-may relation

Hi,

 

I'm looking to get data from one table to another, but it's from the many-side of a many-to-one relation.

 

I have two tables.

Table 1 (1-side)

CRN_0-1656427499869.png

 

Table 2 (n-side)

CRN_1-1656427544565.png

 

While retrieving the data I'm seeking to calculate two columns in table 1.

  1. The earliest value of the Timestamp with the Timestamp Code "Start"
  2. The latest value of the Timestamp with the Timestamp Code "End"

Meanwhile I need the Timestamps to be present for all Machines used for each Prod No.

So I'm looking for Table 1 to look like shown below:

CRN_2-1656427921614.png

 

I appreciate any help! Thanks!

1 ACCEPTED SOLUTION
SpartaBI
Community Champion
Community Champion

@CRN try these 2 calculated columns in table 1:

 

 

 

Earleist Start = 
CALCULATE(
	MIN('Table2'[Timestamp]),
	'Table2'[Timestamp Code] ="Start",
	ALLEXCEPT('Table1', 'Table1'[Prod No])
)

Latest End = 
CALCULATE(
	MAX('Table2'[Timestamp]),
	'Table2'[Timestamp Code] ="End",
	ALLEXCEPT('Table1','Table1'[Prod No])
)

 

 

 

 


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

View solution in original post

3 REPLIES 3
SpartaBI
Community Champion
Community Champion

@CRN try these 2 calculated columns in table 1:

 

 

 

Earleist Start = 
CALCULATE(
	MIN('Table2'[Timestamp]),
	'Table2'[Timestamp Code] ="Start",
	ALLEXCEPT('Table1', 'Table1'[Prod No])
)

Latest End = 
CALCULATE(
	MAX('Table2'[Timestamp]),
	'Table2'[Timestamp Code] ="End",
	ALLEXCEPT('Table1','Table1'[Prod No])
)

 

 

 

 


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

Hi @SpartaBI ,

 

It works like a charm! Thank you!

 

SpartaBI
Community Champion
Community Champion

@CRN my pleasure 🙂
Check out my showcase report - got some high level stuff there. Sure you will find there a lot of cool ideas. 
https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543
Give it a thumbs up over there if you liked it 🙂

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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