Forum Discussion

chavanr's avatar
chavanr
Icon for Resolver I rankResolver I
5 years ago
Solved

Create measure to filter data as per date selection by user

Hi there,

 

I have created a measure to filter data as per date, but want to make it dynamic by the ability to filter the data as per selected

CALCULATE(SUM(TCC_Kerbside[Gardenwaste Flag]),FILTER((TCC_Kerbside),TCC_Kerbside[Gardenwaste Flag] =1),FILTER((TCC_Kerbside),TCC_Kerbside[Date Submitted Month Year] ="July-21"))
 
in the above formula, i have put the month as July 21 but i want it to be dynamic as per the filter selected by user.
 
Cheers,
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi chavanr ,

     

    As amitchandak mentioned——As long as it comes from same table or joined table, no need add that in filter clause

    Please simply use the following formual:

    Measure = CALCULATE(SUM(TCC_Kerbside[Gardenwaste Flag]),FILTER('TCC_Kerbside',[Gardenwaste Flag]=1))

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

3 Replies

  • chavanr , You can use a slicer on the page from the month year from table TCC_Kerbside and that will filter

     

    Or create a date table join it with date of TCC_Kerbside and have month year and other required column there and use that in slicer to filter

     

    As long as it comes from same table or joined table, no need add that in filter clause

     

    To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

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

    Hi chavanr ,

     

    try the selectedvalue function

     

    CALCULATE(
         SUM(TCC_Kerbside[Gardenwaste Flag]),
         FILTER(
          (TCC_Kerbside),
          TCC_Kerbside[Gardenwaste Flag] = 1
         ),
         FILTER(
          (TCC_Kerbside),
          TCC_Kerbside[Date Submitted Month Year] = SELECTEDVALUE(TCC_Kerbside[Date Submitted Month Year])
         )
    )

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi chavanr ,

     

    As amitchandak mentioned——As long as it comes from same table or joined table, no need add that in filter clause

    Please simply use the following formual:

    Measure = CALCULATE(SUM(TCC_Kerbside[Gardenwaste Flag]),FILTER('TCC_Kerbside',[Gardenwaste Flag]=1))

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