Forum Discussion

markefrody's avatar
markefrody
Post Patron
8 years ago
Solved

Please Help in Creating DAX Formula

Hi everyone,   I am trying to create a DAX formula wherein I need to apply a filter and get total for specified columns in the raw data.   Here is what I am trying to accomplish: Filter for Data...
  • v-chuncz-msft's avatar
    v-chuncz-msft
    8 years ago

    markefrody,

     

    Refer to the measure below.

    Measure =
    VAR d =
        SELECTEDVALUE ( 'Calendar'[Date] )
    RETURN
        DIVIDE (
            SUMX (
                FILTER (
                    Table1,
                    ( Table1[Req Date] = d
                        && Table1[Age] IN { 0, 1 } )
                        || ( Table1[Req Date]
                        = d - 1
                        && Table1[Age] = 0 )
                ),
                Table1[Count of Load]
            ),
            SUMX (
                FILTER ( Table1, Table1[Req Date] IN { d, d - 1 } ),
                Table1[Count of Load]
            )
        )