Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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! | |
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 32 | |
| 27 | |
| 25 |