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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Eyal
Helper II
Helper II

find first date of values between -/+ 0.1.

I need a claculated colmun to identify the first date in a group were the value is between +/- 0.1.
Here is the data, the result Should be the dates indicated in arrow
my DAX:

 

CALCULATE(
     MIN('BR Data'[Date]),
         FILTER('BR Data',
         'BR Data'[Lot #]=EARLIER('BR Data'[Lot #]) &&
         'BR Data'[BR_Phase] < 0.1 && BR Data'[BR_Phase] > - 0.1
         )
)

 

Eyal_1-1606914910406.png

 

The intresting part is if i use a specfic value, it works

CALCULATE(MIN('BR Data'[Date]),
FILTER('BR Data',
'BR Data'[Lot #]=EARLIER('BR Data'[Lot #]) &&
'BR Data'[BR_Phase] =0.15
)
)
 
Any advise?
BR
Eyal
1 ACCEPTED SOLUTION
Eyal
Helper II
Helper II

Thank you both for your suggestions

@amitchandak the Measure you suggested works, but I need a calc column as this will surve as a slicer and grouping agent later on.
When I use you calculated colmun solution I get an error "Earlier/Earliest referes to an earlier context wich does not exist"

@V-lianl-msft 
 Using you solution for a claculated column I get back the first date of the Lot group, on the dates where the value is between +/- 0.1

Eyal_0-1607155890031.png

I didnt thought it was relevant on my original post, but I might be missing something.
the colmun "PhaseShift" is aclaculated colmun on its one, the calcualte the relative Log diffreance of a specfic atribute in each lot per day.
Maybe this is wnat cousing the problem???

thanks again for you help
eyal

View solution in original post

5 REPLIES 5
Eyal
Helper II
Helper II

Thank you both for your suggestions

@amitchandak the Measure you suggested works, but I need a calc column as this will surve as a slicer and grouping agent later on.
When I use you calculated colmun solution I get an error "Earlier/Earliest referes to an earlier context wich does not exist"

@V-lianl-msft 
 Using you solution for a claculated column I get back the first date of the Lot group, on the dates where the value is between +/- 0.1

Eyal_0-1607155890031.png

I didnt thought it was relevant on my original post, but I might be missing something.
the colmun "PhaseShift" is aclaculated colmun on its one, the calcualte the relative Log diffreance of a specfic atribute in each lot per day.
Maybe this is wnat cousing the problem???

thanks again for you help
eyal

Hi @Eyal ,

 

Based on your description, I have a little confused with your scenario, any chance you can share a PBIX file with dummy data?

Please remove any sensitive data before uploading.

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

HI @V-lianl-msft 

 

Just figured out what was the mistake from my side.
Your solution works perfeclty.
thank you

 

Eyal

V-lianl-msft
Community Support
Community Support

Hi @Eyal ,

 

Try this:

latest_date =
CALCULATE (
    FIRSTNONBLANK ( 'BR Data'[Date], 1 ),
    FILTER (
        'BR Data',
        'BR Data'[Lot#] = EARLIER ( 'BR Data'[Lot#] )
            && 'BR Data'[BR_Phase] > -0.1
            && 'BR Data'[BR_Phase] <= 0.1
    )
)

V-lianl-msft_0-1607066580005.png

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Eyal , Can check the data type once should work as new column like

 

new column =
CALCULATE(
MINX(FILTER('BR Data',
'BR Data'[Lot #]=EARLIER('BR Data'[Lot #]) &&
'BR Data'[BR_Phase] < 0.1 && 'BR Data'[BR_Phase] > - 0.1
)'BR Data'[Date])

)

 

And new measure like
new measure =
CALCULATE(
MINX(FILTER(allselected('BR Data'),
'BR Data'[Lot #]=max('BR Data'[Lot #]) &&
'BR Data'[BR_Phase] < 0.1 && 'BR Data'[BR_Phase] > - 0.1
)'BR Data'[Date])

)

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors