Forum Discussion

AFRATH34's avatar
AFRATH34
Icon for Helper I rankHelper I
2 years ago
Solved

Help me to write the Measure calculation in Power BI

Hi Team,   I hope this email finds you well.   I need assistance with writing a Measure calculation in Power BI that involves two conditions. Although I have mentioned the two conditions correctl...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi AFRATH34 

     

    Before write a measure, you need to change the format of "New_date1" and "New_date2" to the date type.



    Then try the following measure:

    MEASURE =
    IF (
        SELECTEDVALUE ( 'All'[New_Date1] )
            < SELECTEDVALUE ( Date_Table[SelectedMonthEnd] )
            && SELECTEDVALUE ( 'All'[New_Date1] )
                > SELECTEDVALUE ( Date_Table[SelectedMonthStart] ),
        SELECTEDVALUE ( 'All'[Upfront Gross Profit] )
            * SELECTEDVALUE ( 'All'[IG Forecast TCGP] ),
        BLANK ()
    )
    

     

    Measure2 =
    IF (
        SELECTEDVALUE ( 'All'[New_Date2] )
            < SELECTEDVALUE ( Date_Table[SelectedMonthEnd] )
            && SELECTEDVALUE ( 'All'[Expiry Date] )
                >= SELECTEDVALUE ( Date_Table[SelectedMonthStart] ),
        SELECTEDVALUE ( 'All'[Recurring Gross Profit per Period] )
            * SELECTEDVALUE ( 'All'[IG Forecast TCGP] ),
        BLANK ()
    )
    

     

     

    Result:

     

     

     

     

     

     

     

     

    Best Regards,

    Jayleny

     

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