Forum Discussion
How to get the latest version data in matrix
- 2 years ago
Hi Anonymous
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:In the first step we can find the max value of the version :
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 :
In the next step just filter the table by this comparing column
And delete unnecessary columns
(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'))And filtered measure for the matrix :
Fitered sum =CALCULATE(sum('Table 2'[Value]),FILTER('Table 2','Table 2'[Version ]=[Test last version]))Result:
The pbix with both versions of the solution is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Hi Anonymous
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:
In the first step we can find the max value of the version :
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 :
In the next step just filter the table by this comparing column
And delete unnecessary columns
(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 :
And filtered measure for the matrix :
Result:
The pbix with both versions of the solution is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
- Anonymous2 years agoNot applicable
Thank you so much 😊
- Ritaf19832 years agoSuper User
Happy to help 🙂