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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
jalopez
Regular Visitor

¿Como escribir esta fórmula?

Hola, solicitando de su apoyo...tengo esta formula en excel en la columna:

Por Vencer : =SI(Y(X8778="",Q8778<=Tabla!$F$1),"7 días",SI(Y(X8778="",Q8778<=Tabla!$G$1),"14 días",SI(Y(X8778="",Q8778<=Tabla!$H$1),"21 días",SI(Y(X8778="",Q8778<=Tabla!$I$1),"30 días",SI(X8778="Past Due","Past Due","+30 DÍAS")))))

Tengo esto datos de donde se toma la información para la formula:

jalopez_2-1666730218657.png

Tabla

jalopez_0-1666729935654.png

He tratado pero no logro replicarla en power bi

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @jalopez,

It seems like a common if statement expression to check conditions and return different segment flags.

Since power bi does not include row and column index, I think you need to add index fields to that table if your formula required to look up specific cell values.

Add an index column - Power Query | Microsoft Learn

BTW, please also convert these parameter fields to a table with different groups or indexes, then you can use the formula to look up them as conditions. (para table: group, date)

Sample calculate column formula:

Por Vencer =
IF (
    AND (
        Table[Past Due] = "",
        Table[Ship Date] <= LOOKUPVALUE ( ParaTable[Date], ParaTable[Group], "F" )
    ),
    "7 días",
    IF (
        AND (
            Table[Past Due] = "",
            Table[Ship Date] <= LOOKUPVALUE ( ParaTable[Date], ParaTable[Group], "G" )
        ),
        "14 días",
        IF (
            AND (
                Table[Past Due] = "",
                Table[Ship Date] <= LOOKUPVALUE ( ParaTable[Date], ParaTable[Group], "H" )
            ),
            "21 días",
            IF (
                AND (
                    Table[Past Due] = "",
                    Table[Ship Date] <= LOOKUPVALUE ( ParaTable[Date], ParaTable[Group], "I" )
                ),
                "30 días",
                IF ( Table[Past Due] = "Past Due", "Past Due", "+30 DÍAS" )
            )
        )
    )
)

LOOKUPVALUE function (DAX) - DAX | Microsoft Learn

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

HI @jalopez,

It seems like a common if statement expression to check conditions and return different segment flags.

Since power bi does not include row and column index, I think you need to add index fields to that table if your formula required to look up specific cell values.

Add an index column - Power Query | Microsoft Learn

BTW, please also convert these parameter fields to a table with different groups or indexes, then you can use the formula to look up them as conditions. (para table: group, date)

Sample calculate column formula:

Por Vencer =
IF (
    AND (
        Table[Past Due] = "",
        Table[Ship Date] <= LOOKUPVALUE ( ParaTable[Date], ParaTable[Group], "F" )
    ),
    "7 días",
    IF (
        AND (
            Table[Past Due] = "",
            Table[Ship Date] <= LOOKUPVALUE ( ParaTable[Date], ParaTable[Group], "G" )
        ),
        "14 días",
        IF (
            AND (
                Table[Past Due] = "",
                Table[Ship Date] <= LOOKUPVALUE ( ParaTable[Date], ParaTable[Group], "H" )
            ),
            "21 días",
            IF (
                AND (
                    Table[Past Due] = "",
                    Table[Ship Date] <= LOOKUPVALUE ( ParaTable[Date], ParaTable[Group], "I" )
                ),
                "30 días",
                IF ( Table[Past Due] = "Past Due", "Past Due", "+30 DÍAS" )
            )
        )
    )
)

LOOKUPVALUE function (DAX) - DAX | Microsoft Learn

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Top Solution Authors