Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Need a measure

Hi,

I have to calculate a measure which should be based on the following logic:

 

if "weekend date" = in between ("quarter start date" and "quarter end date") then "Total Hours" else "0"

 

Note: "Total Hours" is a measure which 3 others are table's columns -"weekend date" , "quarter start date" and "quarter end date"

 

Thanks

az38 

Greg_Deckler 

  • Anonymous ,

     

    Create a measure using dax as below:

    Result = IF(MAX('Table'[weekend date]) >= MAX('Table'[Quarter Start Date]) && MAX('Table'[weekend date]) <= MAX('Table'[Quarter End Date]), MAX('Table'[Total Hours]), 0)

     

    Community Support Team _ Jimmy Tao

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

6 Replies

  • az38's avatar
    az38
    Icon for Community Champion rankCommunity Champion

    Anonymous 

    will it help a simple statement like

    Measure=
    IF(Table[weekend date] >= Table[quarter start date] && Table[weekend date] <= Table[quarter end date], Table[TotalTime], 0)
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

       

      I believe this would be more clear:

      weekend dateQuarter Start DateQuarter End DateTotal Hours(Required Measure)
      2/23/20201/6/20204/5/2020140140
      5/20/20204/6/20207/5/20208989
      1/2/20204/6/20207/5/20201230
      6/8/20201/6/20204/5/2020880
      3/12/20201/6/20204/5/2020212212
      • v-yuta-msft's avatar
        v-yuta-msft
        Icon for Community Support rankCommunity Support

        Anonymous ,

         

        Create a measure using dax as below:

        Result = IF(MAX('Table'[weekend date]) >= MAX('Table'[Quarter Start Date]) && MAX('Table'[weekend date]) <= MAX('Table'[Quarter End Date]), MAX('Table'[Total Hours]), 0)

         

        Community Support Team _ Jimmy Tao

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