Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 on the specific year to see each years data so I need to bring in prior year data that ignores the table filters and allows me to apply a different filter. My data is in string format. Essentially looking to achieve the same outcome as 'CALCULATE' (fixed LOD) but for string data.
Solved! Go to Solution.
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
Proud to be a Super User! | |
Hi @powerbi5353
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.
Hi @powerbi5353
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @powerbi5353
Thank you for reaching out microsoft fabric community forum.
I wanted to check if you had the opportunity to review the information provided by @rajendraongole1 . Please feel free to contact us if you have any further questions. If his response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi,
Share some data to work with and show the expected result. Share data in a format that can be pasted in an MS Excel file.
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
Proud to be a Super User! | |
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 37 | |
| 36 | |
| 32 | |
| 31 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 86 | |
| 85 | |
| 68 | |
| 64 |