Forum Discussion

powerbi5353's avatar
powerbi5353
New Member
1 year ago
Solved

Table - Using String Data Applying Different Filters (Ignoring Table Filters)

New to BI - I have a table of data that is filtered by a specific year. I also want to bring in data from a prior year for comparative purposes. The way my data is structured I need to apply filters ...
  • rajendraongole1's avatar
    1 year ago

    Hi powerbi5353  - You can create a calculated column or a measure like this

     

    eg: 

    PriorYearComment =
    CALCULATE(
    MAX(SalesData[Comment]), -- or CONCATENATEX(...) if multiple comments
    FILTER(
    ALL(SalesData), -- removes existing filters on the table
    SalesData[Year] = FORMAT(VALUE(SELECTEDVALUE(SalesData[Year])) - 1, "0000")
    && SalesData[Customer] = SELECTEDVALUE(SalesData[Customer])
    )
    )

     

    You filter the visual or report using Year = 2024, but you want to retrieve Comment from 2023. hope this works. please check