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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Tharun
Frequent Visitor

How to get the latest version data in matrix

Data is available in Version row wise 

Tharun_0-1723460674609.jpeg

we need to take latest version (the latest version in above screenshot is 7) so it need to display 1080 (PROD_QTY) as bellow screenshot .

Tharun_3-1723460711813.jpeg

 

but i am trying in power bi it was showing the data with sum of 1080+1080 = 2160 as below screenshot.

Tharun_2-1723460684916.jpeg

Requirement is need to get the latest version data according to Row_insert_TSTMP , MTOC , Plan_Period_day columns .

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @Tharun 

You can get only the last version in a few ways.

1. You can load to the model only the last version with these few steps in the power query.
Let's imagine we have a simple table with 2 columns:

Ritaf1983_0-1723516200126.png

In the first step we can find the max value of the version :

Ritaf1983_1-1723516335343.pngRitaf1983_2-1723516351377.png

Note that the previous step should be a part of the formula (Changed type)
=List.Max(#"Changed Type"[#"Version "])

As we have this formula we can compare it to the version with the conditional column :

Ritaf1983_3-1723516498479.pngRitaf1983_4-1723516513118.png

In the next step just filter the table by this comparing column

Ritaf1983_5-1723516568233.png

And delete unnecessary columns

Ritaf1983_6-1723516628930.png

(these steps will be repeated every report refresh )
So you will load only last version rows.

 

Second option

If the goal is to create a filter for the visual only, you can create a measure with a similar logic :

Measure testing the version :
Test last version = CALCULATE(max('Table 2'[Version ]),all('Table 2'))
Ritaf1983_8-1723517645059.png

And filtered measure for the matrix :

Fitered sum =
CALCULATE(sum('Table 2'[Value]),FILTER('Table 2','Table 2'[Version ]=[Test last version]))

Result:

Ritaf1983_9-1723517759517.png

The pbix with both versions of the solution is attached

Ritaf1983_10-1723517823418.png

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi @Tharun 

You can get only the last version in a few ways.

1. You can load to the model only the last version with these few steps in the power query.
Let's imagine we have a simple table with 2 columns:

Ritaf1983_0-1723516200126.png

In the first step we can find the max value of the version :

Ritaf1983_1-1723516335343.pngRitaf1983_2-1723516351377.png

Note that the previous step should be a part of the formula (Changed type)
=List.Max(#"Changed Type"[#"Version "])

As we have this formula we can compare it to the version with the conditional column :

Ritaf1983_3-1723516498479.pngRitaf1983_4-1723516513118.png

In the next step just filter the table by this comparing column

Ritaf1983_5-1723516568233.png

And delete unnecessary columns

Ritaf1983_6-1723516628930.png

(these steps will be repeated every report refresh )
So you will load only last version rows.

 

Second option

If the goal is to create a filter for the visual only, you can create a measure with a similar logic :

Measure testing the version :
Test last version = CALCULATE(max('Table 2'[Version ]),all('Table 2'))
Ritaf1983_8-1723517645059.png

And filtered measure for the matrix :

Fitered sum =
CALCULATE(sum('Table 2'[Value]),FILTER('Table 2','Table 2'[Version ]=[Test last version]))

Result:

Ritaf1983_9-1723517759517.png

The pbix with both versions of the solution is attached

Ritaf1983_10-1723517823418.png

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Thank you so much 😊

Happy to help 🙂

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors