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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
MohamadAshuryan
Frequent 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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