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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Learner86
Helper I
Helper I

Delete rows and groupby

Dear community, 

 

how can I solve the following problem: 

UsernameTypCostsFrequencyIndex
MustermanM12561
MustermanM320062
MustermanM320063
MustermanM40064
SaundersN380015
WootenK320016
BrownB380027
BrownB12528

 

I want to keep all rows with frequency 1 and if the frequency is bigger  than 1, then I want to keep the most expensive one (regarding the column costs). That means I want to keep the rows with the index number 2, 3, 5, 6, 7 and delete the rows with the numer 1 , 4,  8. How can I do this?

 

Thank you very much!

 

Best regards

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

in dax:

new table=filter(table1,VAR _max=calculate(max(table1[costs]),allexcept(table1,table1[username],table1[typ])) RETURN table1[costs]=_max)

View solution in original post

2 REPLIES 2
wdx223_Daniel
Super User
Super User

in dax:

new table=filter(table1,VAR _max=calculate(max(table1[costs]),allexcept(table1,table1[username],table1[typ])) RETURN table1[costs]=_max)

It works, thank you very much wdx223_Daniel

Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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