Forum Discussion
Filtering rows based on cascading sequence
- 6 years ago
Hi mef47 ,
We can use the Power Query Editor to meet your requirement.
1. Filter the Model column, delete the rows that contain “gm”.
2. We sort the sample ID Ascending, and sort the Model Descending.
3. Then we need to Group the Sample ID column.
4. And we can add a custom column to add an index column. Each group has an index column.
5. Delete the first two columns. And expand the last column.
6. At last we need to filter the Rank column equal 1, then delete the rank column.
The result table just has four rows.
If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?
Best regards,
Community Support Team _ zhenbw
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BTW, pbix as attached.
Hi mef47 -
Presuming that the "latest" model will be the MM with the highest number, we can create the following 3 measures:
Latest Model = CALCULATE(MAX(Samples[Model]))
Latest K =
VAR __model = [Latest Model]
VAR __sample =
SELECTEDVALUE ( Samples[Sample ID] )
RETURN
LOOKUPVALUE (
Samples[K],
Samples[Model], __model,
Samples[Sample ID], __sample
)
Latest S =
VAR __model = [Latest Model]
VAR __sample =
SELECTEDVALUE ( Samples[Sample ID] )
RETURN
LOOKUPVALUE (
Samples[S],
Samples[Model], __model,
Samples[Sample ID], __sample
)
Create a table visual, put Sample ID as the first value, then the 3 measures:
Hope this helps,
David
Hi David
Not quite what I was after but helpful enough to get me to where I wanted to go.
The ALLEXCEPT function what what I was after
I ended up going with: