cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MohamadAshuryan
Regular Visitor

How can I get the uniqe list off Last occurred for each category?

Hi every one.

 

I have this list:

 

products---Prices

product1---1000

product2---2000

product1---900

product3---4000

product2---5000

product3---6000

 

and I wand to get the uniqe list off Last prices for each products with DAX Like this:

 

products---Prices

product1---900

product2---5000

product3---6000

 

 

1 ACCEPTED SOLUTION

Sorry Mohammad,

It was too late last night I didn't see your reply. Here is a sample file with the solution https://we.tl/t-rBJAfyJOu4

1.png

Last Price = 
VAR MaxIndex = MAX ( Products[Index] )
RETURN
    CALCULATE ( 
        MAX ( Products[Prices] ),
        Products[Index] = MaxIndex
    )

View solution in original post

9 REPLIES 9
tamerj1
Super User
Super User

@MohamadAshuryan 

Can't you add index column using Power Query?

How can I do that?

Sorry Mohammad,

It was too late last night I didn't see your reply. Here is a sample file with the solution https://we.tl/t-rBJAfyJOu4

1.png

Last Price = 
VAR MaxIndex = MAX ( Products[Index] )
RETURN
    CALCULATE ( 
        MAX ( Products[Prices] ),
        Products[Index] = MaxIndex
    )

Thank you very much tamerj1.

@MohamadAshuryan 

open the query editor. From the add columns tab select add index column. 

So what shoud I do next?

tamerj1
Super User
Super User

Hi @MohamadAshuryan 

do you have index or date column?

Hi tamerj1,

No, Suppose we have only these two columns.

@MohamadAshuryan 

Then the required result is not possible 

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors