Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I want to buid a visulation that will only display results from the last period. I have a data model that includes monthly data. I want to display the last period based on the year I select from the slicer.
I built a measurement "LastPeriod = (max ('Table'[Period]))" to show the last period. But I have a challenge to filter my results based on this calculated LastPeriod. I tried to build it in a column instead, but the column will be calcultated based on all data in the table, instead of the filtered data only.
Thank you.
Andy
Solved! Go to Solution.
Hi @Andy_Lee
What is in your Period column? Which type of visual do you want to use? Can you provide some sample data and more detailed expected output to help us understand it better?
Assume your original data is like below and Period column has Month numbers. You can add a Date table into your model. In Date table, add a Year column. And create a relationship between Date table and Fact Data table on Date columns (one-to-many, Single).
Then you can use a measure like below to calculate the total of Sales in Last Period of a selected Year.
LastPeriod Sales = CALCULATE(SUM(Sales[Sales]),FILTER(Sales,Sales[Period]=MAX(Sales[Period])))
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi @Andy_Lee
What is in your Period column? Which type of visual do you want to use? Can you provide some sample data and more detailed expected output to help us understand it better?
Assume your original data is like below and Period column has Month numbers. You can add a Date table into your model. In Date table, add a Year column. And create a relationship between Date table and Fact Data table on Date columns (one-to-many, Single).
Then you can use a measure like below to calculate the total of Sales in Last Period of a selected Year.
LastPeriod Sales = CALCULATE(SUM(Sales[Sales]),FILTER(Sales,Sales[Period]=MAX(Sales[Period])))
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.