Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Convert excel formula into Power bi

Hi all,  I'm trying to import an excel calculation which includes multiple filters into Power Bi, but I'm having big trouble. The formula is to calculate an end date based on user input date and two...
  • v-juanli-msft's avatar
    6 years ago

    Hi Anonymous 

    Create measures

    Measure =
    VAR M1 =
        MAX ( 'date'[Period end] )
    VAR M2 =
        MAX ( [issuer status] )
    RETURN
        IF (
            M1 <> "Q3",
            IF (
                M2
                    IN {
                    "LAF",
                    "AF"
                },
                129,
                134
            ),
            SWITCH (
                TRUE (),
                M2 = "LAF", 60,
                M2 = "AF", 75,
                M2
                    IN {
                    "Initial filter",
                    "LAF/AF"
                }, 45,
                M2
                    IN {
                    "NAF",
                    "SBC/EGC"
                }, 90
            )
        )
    
    Measure 2 = IF(MAX('date'[Date])=MAX('Table'[date]),1,0)

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