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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Arancium
New Member

Select Column as index

Hello,

 

I have a table that already have an index column. I want to keep it this way. How can i do it?

(I want it to be like like on padas .

 

df = pd.read_csv("file.csv, index_col= ["index"])

 

)

Example table:

IndexABCDE
112311241xdasdasda
223121241xdsadasda
3412411241xdasdsaa

 

Hope anyone could give me a hand thanks!!

1 ACCEPTED SOLUTION

hello you forgot to add calculate in the start before the (MAX

Measure = CALCULATE( MAX(Promedios[PS1]) , FILTER(Promedios, [Índice] = MAX(Promedios[Índice])))




View solution in original post

8 REPLIES 8
Arancium
New Member

Some background about what i'm tryng to do.

 

I'm trying to get the last value from a colum using this DAX

LastPS1 = LASTNONBLANK(Promedios[PS1], Promedios[PS1])

The problem is when i use this code i got the MAX value instead the LAST value. I think it is because power BI its not getting the index i set

Last Value = 

Calculate ( MAX(Promedios[PS1]) , FILTER(Table, [index] = max[index]))

this should return your latest value

here is a small sample

annonymous1999_0-1691678261989.png

 

I'm having an issue with the code:

LastPS1 = ( MAX(Promedios[PS1]) , FILTER(Promedios, [Índice] = MAX(Promedios[Índice])))

The error is The '( )' operator or expression is not supported in this context. 

Thanks for your time @eliasayyy !

hello you forgot to add calculate in the start before the (MAX

Measure = CALCULATE( MAX(Promedios[PS1]) , FILTER(Promedios, [Índice] = MAX(Promedios[Índice])))




Thanks a lot for your time @eliasayyy 

eliasayyy
Memorable Member
Memorable Member

go to powerquery 

press on add columns in the ribbons

add index column

annonymous1999_0-1691676161469.png

 



This way i create a new column. I need to use the original named index

when you import your table it should get imported too can you please explain more

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.