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
Anonymous
Not applicable

Get value on a record where the date falls between two dates

Hi i have a calendar table and I'd like to pull the iteration from another table into a new field or measure

Here's  a screen print of my objective

StevenT_0-1670943468260.png

So if the date on the left is between 12/26/18 -01/08/19, I want to reference the Iteration-Original,which is 2018Q4-IP

if the date on the left is between 01/09/19 -01/29/19, I want to reference the Iteration-Original,which is 2019Q1-1

How do i write a measure or create a column to do this?

If a column, would it be better to create it as a power query column or a dax column?
I'm thinking that a new column where the iteration-Original can be added, as compared to a measure, but not sure.

Open to any suggestion.
Thanks, Steve

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@Anonymous 

A column like this should get you what you are looking for.

 

Iteration = 
VAR _Date = [Date] 
RETURN
CALCULATE(
    MAX ( Iterations[Iteration-Original] ),
    Iterations[IterationStartDate] <= _Date && Iterations[IterationEndDate] >= _Date
)

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@Anonymous 

A column like this should get you what you are looking for.

 

Iteration = 
VAR _Date = [Date] 
RETURN
CALCULATE(
    MAX ( Iterations[Iteration-Original] ),
    Iterations[IterationStartDate] <= _Date && Iterations[IterationEndDate] >= _Date
)

 

Anonymous
Not applicable

Your code made the difference. I did make a few modifications but your code acted as a template and I can use it going forward.  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.