Forum Discussion

nbufff's avatar
nbufff
Helper I
1 year ago
Solved

Show previous date data on matrix table

Dear Community, I stuck on issue how to show previous date data on matrix table.    I made matrix table showing qty each day from plant A and B. I want to make it as  showing in  second picture wi...
  • DataNinja777's avatar
    DataNinja777
    1 year ago

    Hi nbufff ,

     

    You can produce your required output by writing a dax measure like below:

     

    Date_Diff = 
    VAR StartDate = DATE(2024, 11, 1)  -- Starting point
    VAR CurrentDate = SELECTEDVALUE(Calendar[Date])
    RETURN
    IF(
        CurrentDate >= StartDate,
        CALCULATE(
            COUNTROWS('Calendar'),
            FILTER(
                ALL('Calendar'),
                Calendar[Date] >= StartDate &&
                Calendar[Date] <= CurrentDate &&
                Calendar[IsWorkingDay] = 1
            )
        ),
        BLANK()  -- If the date is before November 1, return blank
    )
    

     

    The resulting output is shown below. I've transposed the visualization to save space.

     

     

    I have attached an example pbix file for your reference.

     

    Best regards,