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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ratercero
Helper III
Helper III

Formula not showing earliest Value

Hello, 

 

Im looking to determine the first dyelot nomber produces with a certain color and Yarn lot, the formula keeps showing another dyelot number:

 

Here is the formula I used:

 

Yarn First Dye = 
CALCULATE (
    FIRSTNONBLANK ( HILAZA_ACUM[DYELOT]; HILAZA_ACUM[DYELOT] );
    CALCULATETABLE (
        HILAZA_ACUM;
        ALLEXCEPT ( HILAZA_ACUM; HILAZA_ACUM[LOTE HILAZA DEPURADO];HILAZA_ACUM[Cod. Color] );
        MIN(HILAZA_ACUM[FECHA];HILAZA_ACUM[FECHA])
    )
)

This is what I get:

Capture 2.PNG

 

 

I dont understand why but Ignores values that start with alfabetical caracters and it should not.

 

Please advise how to resolve.

 

Best Regards

 

RT

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @ratercero,

 

Try this formula, please.

Measure =
VAR earliestDate =
    CALCULATE (
        MIN ( HILAZA_ACUM[FECHA] ),
        ALLEXCEPT (
            HILAZA_ACUM,
            HILAZA_ACUM[Cod. Color],
            HILAZA_ACUM[LOTE HILAZA DEPURADO]
        )
    )
RETURN
    CALCULATE (
        MIN ( HILAZA_ACUM[DYELOT] ),
        FILTER (
            ALLEXCEPT (
                HILAZA_ACUM,
                HILAZA_ACUM[Cod. Color],
                HILAZA_ACUM[LOTE HILAZA DEPURADO]
            ),
            HILAZA_ACUM[FECHA] = earliestDate
        )
    )

Formula_not_showing_earliest_Value

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-jiascu-msft
Employee
Employee

Hi @ratercero,

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Employee
Employee

Hi @ratercero,

 

Try this formula, please.

Measure =
VAR earliestDate =
    CALCULATE (
        MIN ( HILAZA_ACUM[FECHA] ),
        ALLEXCEPT (
            HILAZA_ACUM,
            HILAZA_ACUM[Cod. Color],
            HILAZA_ACUM[LOTE HILAZA DEPURADO]
        )
    )
RETURN
    CALCULATE (
        MIN ( HILAZA_ACUM[DYELOT] ),
        FILTER (
            ALLEXCEPT (
                HILAZA_ACUM,
                HILAZA_ACUM[Cod. Color],
                HILAZA_ACUM[LOTE HILAZA DEPURADO]
            ),
            HILAZA_ACUM[FECHA] = earliestDate
        )
    )

Formula_not_showing_earliest_Value

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

If you mean first Dyelot with regards to FECHA, maybe you could use this:

 

CALCULATE( FIRSTNONBLANK (HILAZA_ACUM [DYELOT] ) , 
FILTER ( HILAZA_ACUM,
        (HILAZA_ACUM [FETCHA] ) = MAX (HILAZA_ACUM [FETCHA] )))

You could just modify it further to achieve what you want. You just have to get the the first data with regards to the date in the table, if that's what you meant by 'first' data. 

 

Hope this helps!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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