Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Andy_Lee
Frequent Visitor

Display only the last period visualization

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

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

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).

vjingzhang_0-1644977747158.png

 

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])))

vjingzhang_1-1644978168331.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

1 REPLY 1
v-jingzhang
Community Support
Community Support

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).

vjingzhang_0-1644977747158.png

 

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])))

vjingzhang_1-1644978168331.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors