Forum Discussion

anin's avatar
anin
Frequent Visitor
5 years ago
Solved

Count specific values based on latest date

Hello,   I would like to count data entries with a specific value based on latest selected less than or equal date and have created a date table with a separate slider in my report.   This is my ...
  • v-kelly-msft's avatar
    v-kelly-msft
    5 years ago

    Hi  anin ,

     

    Modify the measure as below:

     

    Measure = 
    var _maxdate=CALCULATE(MAX('Table'[Date]),FILTER(ALLSELECTED('Table'),'Table'[Date]<=SELECTEDVALUE('calendar table'[Date])&&'Table'[ID]=MAX('Table'[ID])))
    var _tab=SUMMARIZE('Table','Table'[ID],'Table'[Date],"value",IF(MAX('Table'[Date])=_maxdate&&MAX('Table'[Value1])=2&&MAX('Table'[Value2])=2,1,BLANK()))
    Return
    SUMX(_tab,[value])
    sum = SUMX(VALUES('Table'[ID]),[Measure])

     

    And you will see:

    For the related .pbix file,pls see attached.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!