Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter exp

Hello;

 

When trying to run a calculation I am getting the error described in the title.

Here is the dax expression:

 

currentMonthPunchedHours = CALCULATE(sum(punches[hours]), and(True, and(YEAR(punches[punchIn]) * 12 + MONTH(punches[punchIn]) = YEAR(TODAY()) * 12 + MONTH(TODAY()), and(YEAR(punches[punchOut]) * 12 + MONTH(punches[punchOut]) = YEAR(TODAY()) * 12 + MONTH(TODAY()), day(punches[punchIn]) < day('measure stuff'[breakEnd])))))
 
Thanks for the help

10 Replies

  • Anonymous 

    Can you try this version:

    currentMonthPunchedHours =
    CALCULATE (
        SUM ( punches[hours] ),
        FILTER (
            ALL ( punches ),
            AND (
                YEAR ( punches[punchIn] ) * 12 + MONTH ( punches[punchIn] ) = YEAR ( TODAY () ) * 12 + MONTH ( TODAY () ),
                AND ( YEAR ( punches[punchOut] ) * 12 + MONTH ( punches[punchOut] ) = YEAR ( TODAY () ) * 12 + MONTH ( TODAY () ),
                    DAY ( punches[punchIn] ) < DAY ( 'measure stuff'[breakEnd] )
                )
            )
        )
    )
    
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you,

      The query is not giving error anymore but I am not getting any data.

      The breakEnd is set to be the maximum value of a date column used on a slider if that might help.

      • Fowmy's avatar
        Fowmy
        Super User

        Anonymous 

        In this case, you will need to share a sample or dummy file showing the scenario and the exepected results. 

        Please save your file in Cloud file storage service like google drive and share the link here