Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Here is a Power Bi Report. Can someone create a measure I can use as a filter to show the last 3 years for any customer. Customers are selected from Slicer on Selection Page which populates Page 1 columns.
https://drive.google.com/file/d/1icSIA3aShqN3Ddb2p5WFO2vManfgfJhu/view?usp=drive_link
Solved! Go to Solution.
Here is the File that I did get to work. I took Last3YearsFilter below and put it in ChatGPT and got the measure corrected.
https://drive.google.com/file/d/104cWzIh7ei2zwQzFjXR1LkFAy6odeE7X/view?usp=sharing
Hi,
I cannot understand your question. Show the expected result very clearly.
Here is the File that I did get to work. I took Last3YearsFilter below and put it in ChatGPT and got the measure corrected.
https://drive.google.com/file/d/104cWzIh7ei2zwQzFjXR1LkFAy6odeE7X/view?usp=sharing
Sorry it should be this file. https://drive.google.com/file/d/12ndhq72lIESoi2t4kA4uo02k0weMwaaG/view?usp=sharing
I have not received a valid measure yet.
@bdehning Hey,
you can use below measure
Last3YearsFilter =
VAR MaxYear = MAX(CustomerTable[Year]) -- Get the maximum (most recent) year selected or available
VAR Last3Years = MaxYear - 3 -- Calculate the year that is 3 years before the most recent year
RETURN
IF (
CustomerTable[Year] >= Last3Years && CustomerTable[Year] <= MaxYear, -- Filter for the last 3 years
1, -- Return 1 if the year is within the last 3 years
0 -- Return 0 otherwise
)
If you use aboce measure then you will get 3 year worth record when you select 1 in filter.
Thanks
Harish M
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query
I put this in as Measure
Hi @bdehning - as per the shared pbix file, there is no last three years data. i have created a measure plesae check added in visual filter too.
Proud to be a Super User! | |
That is why I need a measure. There is 3 years or more of data but most are not within the last 3 calendar years.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
75 | |
68 | |
39 | |
35 |
User | Count |
---|---|
107 | |
56 | |
52 | |
48 | |
40 |