Forum Discussion

Mohan_Vanku's avatar
Mohan_Vanku
Frequent Visitor
10 months ago
Solved

Matrix visual showing only selected date for current month instead of all dates up to selected date

Hi everyone, I’m facing an issue with my Power BI report related to date filtering. In my dataset, the date column contains end-of-month dates for all previous months, but for the current month, it...
  • Kedar_Pande's avatar
    10 months ago

    Use a standard date table with continuous dates. Create this measure:

    Production to Date =
    CALCULATE(
    SUM(Production[Value]),
    FILTER(
    ALL('Date'),
    'Date'[Date] <= MAX('Date'[Date]) &&
    'Date'[Date] >= EOMONTH(MAX('Date'[Date]), -1) + 1
    )
    )
     

    Use this measure in your matrix and slice by your date table, not the production date column.

     

  • rohit1991's avatar
    rohit1991
    10 months ago

    Hi Mohan_Vanku 

    This issue happens because your SelectedDate table has:

    • End-of-month dates for older months, and
    • Daily dates for the current month.

    So, when you select a date like 15 Oct, Power BI shows only that day’s data.

    To fix this:

    1. Create a new DAX measure:

            ShowTillSelectedDate =

            VAR _maxDate = MAX('cmpst_calendar'[SelectedDate])
            VAR _monthStart = STARTOFMONTH('cmpst_calendar'[SelectedDate])
            RETURN
            IF(
            'cmpst_calendar'[SelectedDate] >= _monthStart &&
            'cmpst_calendar'[SelectedDate] <= _maxDate,
            1
             )​

         2.Add this measure to your visual-level filters.

         3.Set the filter to ShowTillSelectedDate = 1.

         4.Use the date from your calendar table (not production date).