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
MA_guy_VER
Advocate I
Advocate I

Return a value associated to a date with criteria

Hi - It's the new guy again... 

 

I am looking to return the value associated with a date. 

 

In this example, you can see in yellow the areas I am in need of using:  If 6 Weeks = 1, Find the MAX date (August 21) from that grouping and then return the PROJ BAL (84) associated with that date.

 

MA_guy_VER_0-1658176868644.png

 

Thank you in advance once again.  This community is so helpful!

1 ACCEPTED SOLUTION

Hi @MA_guy_VER 

 

You can create a measure with below code. I assume that you want to get the [PROJ BAL] value of every item on their associated maximum date. To display the result, you can put the measure into a table along with the [Item #] column. 

Result =
VAR _maxDate =
    CALCULATE (
        MAX ( 'Table'[Curr Cust Ship] ),
        ALLEXCEPT ( 'Table', 'Table'[Item #] ),
        'Table'[6 Weeks] = 1
    )
RETURN
    CALCULATE (
        MAX ( 'Table'[PROJ BAL] ),
        ALLEXCEPT ( 'Table', 'Table'[Item #] ),
        'Table'[Curr Cust Ship] = _maxDate
    )

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

4 REPLIES 4
MA_guy_VER
Advocate I
Advocate I

@amitchandak My apologies if it is not clear.

 

With the above example, I want to filter the data on 6 Week and only take the "1"s.  Then from the grouping of the "1" I want to get the MAX Date from that group (Curr Cust Ship).  Once the MAX date is determined, I want to return the value in the PROJ BAL column associated with the MAX Date.  Based on the above, the MAX date is August 21, 2022 and the value that should return is 84.  The end result should be returning the number 84 in this example.  Thank you and I hope this makes the ask more clear.

Hi @MA_guy_VER 

 

You can create a measure with below code. I assume that you want to get the [PROJ BAL] value of every item on their associated maximum date. To display the result, you can put the measure into a table along with the [Item #] column. 

Result =
VAR _maxDate =
    CALCULATE (
        MAX ( 'Table'[Curr Cust Ship] ),
        ALLEXCEPT ( 'Table', 'Table'[Item #] ),
        'Table'[6 Weeks] = 1
    )
RETURN
    CALCULATE (
        MAX ( 'Table'[PROJ BAL] ),
        ALLEXCEPT ( 'Table', 'Table'[Item #] ),
        'Table'[Curr Cust Ship] = _maxDate
    )

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

@v-jingzhang Nailed it!  Thank you very much for the assistance.  Much appreciated!

amitchandak
Super User
Super User

@MA_guy_VER , The information you have provided is not making the problem clear to me. Can you please explain with an example.

 

You can try a measure like

 

calculate(Sum(Table[PROJ BAL]), filter(Table, [6 Weeks] = 1 )) 

 

Plot with dates and other column


Appreciate your Kudos.


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