The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi Experts!
I am investigating data lags in the Adventure Works PBIX. Accordingly, I have made some updates to the Sales table by trimming the data for each category as follows:
Accessories: No data past November 2019
Bikes: No data past May 2020
Clothing: No data past June 2020
Components: No data past February 2020
Requirement:
The user wants to view a single year plot of Sales performance by Category with the most up-to-date YTD Sales Amount versus Prior Year YTD Sales Amount.
Partial Solution:
I have created the following two measures that work as expected:
Problem:
When the user clicks on Accessories, since the data is only through November 2019, the Year filter in the plot needs to be updated to 2019. Below is what the plot should update to if I hard code the filter value to 2019.
How do I make the filter value update automatically to 2019 when the user selects Accessories versus Bikes, etc?
Thanks in advance for the help!
Solved! Go to Solution.
@dharmendars007 Thank you so much for your reply!
I tried your solution with some slight modifications:
I created the following three measures:
I feel like I am so close and just need a little nudge in the right direction. Thank you so much for your help!
Hello @WishAskedSooner ,
You can use the below measure to get the MAX year and the use this measure to in a measure Dynamic Year and add this in the visual filter
MaxYearByCategory =
CALCULATE(MAX(Sales[OrderDateKey]),
Sales[Category] = SELECTEDVALUE(Sales[Category]))
DynamicYear = YEAR([MaxYearByCategory])
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!
Thank You
Dharmendar S
@dharmendars007 Thank you so much for your reply!
I tried your solution with some slight modifications:
I created the following three measures:
I feel like I am so close and just need a little nudge in the right direction. Thank you so much for your help!