Forum Discussion

AsafPinhas's avatar
AsafPinhas
Regular Visitor
3 years ago
Solved

How to Show data up to a certain Month?

Hi,    i have a transactional data of my share in hospitals, it contains the following columns: [Month] - the month of the report [Hospital Code] - identifier unique for each hospital on my list ...
  • AsafPinhas's avatar
    3 years ago

    Hi, 

     

    so found a nice solution to this issue:

    1. created a single column table containing only the Last Update date for each hospital not connected to any other table in the model

    2. building a single-select filter based on this table 

    3. creating a virtual table within a measure:

    VAR LastUpDate = SELECTEDVALUE(Dim_LastDate[Last Update])
    VAR Hospitable =
        CALCULATETABLE(Fact_HospitalShare, FILTER((Fact_HospitalShare), Fact_HospitalShare[LastUpdate]>= LastUpDate), FILTER(Fact_HospitalShare, Fact_HospitalShare[Date]<=LastUpDate))
    Return
    SUMX(Hospitable, [Total Usage])

    this way the virtual table contains only data for hospitals reported up to or later than the selected date and for these hospitals it contains only the data up to the selected date.