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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
mecasteel
Regular Visitor

Compare two columns and filters

I would like to use DAX to compare [SiteID] of the same [AsOfDate] and [CustomerPartNo] and add the [LastUsedDate] to the opposite [SiteID].  After creating the two new columns and adding [LastUsedDate] to each, I’m at a lost on how to proceed. I hope someone would know the best way to do this.  Below is sample output.

 

AsOfDate

SiteID

CustomerPartNo

LastUsedDate

MC LastDate Used

SC LastDate Used

8/2/21

SC

00309SR37010

7/27/21

7/26/21

7/27/21

8/2/21

MC

00309SR37010

7/26/21

7/26/21

7/27/21

8/2/21

SC

95060XC30009

7/22/21

7/21/21

7/22/21

8/2/21

MC

95060XC30009

7/21/21

7/21/21

7/22/21

9/6/21

SC

95060XC30004

BLANK

8/16/21

BLANK

9/6/21

MC

95060XC30004

8/16/21

8/16/21

BLANK

 

 

1 ACCEPTED SOLUTION
smpa01
Super User
Super User

@mecasteel  please try this

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

4 REPLIES 4
smpa01
Super User
Super User

@mecasteel  Can you please attach your pbix here through 1drive/gdrive?

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

can't right now, traveling.

smpa01
Super User
Super User

@mecasteel  please try this

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

your PBIX works great, but when i apply it to the full table - I get error 'EARLIER/EARLIEST  refers to an earlier row context which doesn't exist.'

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.