Forum Discussion

ScottScott's avatar
ScottScott
New Member
4 years ago
Solved

Find values that were not previously there

I have various CSV files (one for each date) with the same structure of data in each (name and amount).  I have already joined them in PowerBI and have added a column that shows the date (taken from ...
  • askhanduja's avatar
    4 years ago

    Hi,

     

    Please see the sample solution here.

     

    You can create a data model that looks like the following:

     

     

    and then write a measure like this:

     

    New Names Count = 
    VAR __CurrentDate = MAX('Dates'[Date])
    VAR __NamesOnCurrentDate =
    CALCULATETABLE(
        VALUES(factNamesAmounts[Name]),
        'Dates'[Date] = __CurrentDate
    )
    VAR __NamesPriorToCurrentDate =
    CALCULATETABLE(
        VALUES(factNamesAmounts[Name]),
        'Dates'[Date] < __CurrentDate
    )
    VAR __NewNamesOnCurrentDate =
    EXCEPT(__NamesOnCurrentDate, __NamesPriorToCurrentDate)
    VAR __Result = COUNTROWS(__NewNamesOnCurrentDate)
    RETURN
    __Result

     

    You get an output like this:

     

    Hope this helped. If it solves your issue please do mark this post as the solution so others with similar issues may find the solution and I would really appreciate a thumbs up.