Forum Discussion

slyfox's avatar
slyfox
Helper II
7 years ago
Solved

Simple measure

Hello,

 

PLease help with measures with folowing logic

if today 30-Oct
Sum CUS_ReceivablesAmt  / Sum IVCL_GrossAmt for the last 30 days IVC_Date = 1 122 815.55 / 163 611.18  = 6.86

 

PBI File

 

  • Hi slyfox

     

    You may try to use below measure. 

    Measure =
    VAR today =
        DATE ( 2015, 10, 30 )
    VAR a =
        CALCULATE (
            SUM ( Customer[CUS_ReceivableAmt] ),
            FILTER ( Invoice, Invoice[CUS_Id] = 10017 )
        )
    VAR b =
        CALCULATE (
            SUM ( Invoice[IVCL_GrossAmt] ),
            FILTER (
                ALL ( 'Date' ),
                'Date'[DATE_Date]
                    > today - 30
                    && 'Date'[DATE_Date] <= today
            ),
            FILTER ( Invoice, Invoice[CUS_Id] = 10017 )
        )
    RETURN
        DIVIDE ( a, b )

    Regards,

    Cherie

1 Reply

  • v-cherch-msft's avatar
    v-cherch-msft
    Microsoft Employee

    Hi slyfox

     

    You may try to use below measure. 

    Measure =
    VAR today =
        DATE ( 2015, 10, 30 )
    VAR a =
        CALCULATE (
            SUM ( Customer[CUS_ReceivableAmt] ),
            FILTER ( Invoice, Invoice[CUS_Id] = 10017 )
        )
    VAR b =
        CALCULATE (
            SUM ( Invoice[IVCL_GrossAmt] ),
            FILTER (
                ALL ( 'Date' ),
                'Date'[DATE_Date]
                    > today - 30
                    && 'Date'[DATE_Date] <= today
            ),
            FILTER ( Invoice, Invoice[CUS_Id] = 10017 )
        )
    RETURN
        DIVIDE ( a, b )

    Regards,

    Cherie