Forum Discussion

AdrianLock's avatar
AdrianLock
Helper I
3 years ago

Filter date table using measure

I have an issue with a KPI report I have.  The report shows KPI for our it tickets for example if the Breached response or if they where fixed first time.   The report has number of KPI per page and shows last month % and below 3 months % in line chart.  We currently use basically the following code.   

 

 

  IF(
            ISFILTERED(
                IV_dim_CALENDAR_ResolvedDate[YearMonthShort])
                , CALCULATE([_KPI_FirstCallRes]
            ),
            CALCULATE([_KPI_FirstCallRes]
                ,  IV_dim_CALENDAR_ResolvedDate[Is Current Month] = "True"
            )
        )

 

However I want to change this so that Specific date table is filter useing a measure.  If no specific month is selected then use last month as the filter.    Because currently way we do will not carry the last month date through to our drill-through page properly.  It only works if you select a specific date.  In our caase from small line chart shown under the KPI % .

I feel this should be simple enough but I cannot get it to work  (I would supply pbix to help but ours has over 30+ tables in it)

2 Replies

  • AdrianLock , You can not create a new table, which will filter by measure. As it will only take the static value of the measure.

    You can create a measure that will filter based on another measure and use that in visualization

     

    Sumx(filter(Table, [Measure] >1),[Measure]) 

     

    or

     

    Sumx(filter(Values(Table[Visual Column]), [Measure] >1),[Measure]) 

     

  • I'm not sure I understand.  I don't want to create a new table but  in some way filter the date table I have to just show required date range.   Ie 

    IF ISFILTERED(IV_dim_CALENDAR_ResolvedDate[YearMonthShort]) , filter the table to that year\month, filter to year\month where IV_dim_CALENDAR_ResolvedDate[Is Current Month] = "True"

    Then be able to put that onto each of the required visuals as a filter

    If this cannot be done then I need away to pass through the date to the drill through page.  Initially the measures check if is filtered then dose a calculation.  If it is not filtered then it does a calculation based on those rows in date table which have column [is current month] = "true".  However the [is current month] value is not filtering the drill through page