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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Row_Number (By Partition)

Hi 

 

I saw identical question so using the same I  am also looking for ;

 

Select  DateKey ,Line_Number, 
        Suite_name, 
        Group_Name, 
        Revision, 
        Status, Met
FROM ( select DateKey, Line_Number, Suite_Name, Group_Name, Revision, Status, Met, Row_Number() OVER (Partition by Line_Number, Suite_Name, Group_Name order by Revision Desc) r From TableA ) twhere t.r = 1 and DateKey Between 20170101 AND 20170223

 

This query returns the highest Revision's row per Line_Number, Suite_Name, and Group_Name.

I want to do the same, but with DAX in SSAS Tabular so I can use the same in Power BI.

The result will be SUM of [Met] , but for the selected (slicers) .

The goal is to select all rows into the tabular data model, and then, using similar functionality, filter the records and keep only latest revision per applied slicers.

 

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

Can you share a dummy sample please? It's hard to write a DAX without data and its structure.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thanks for your reply !!

 

Following is the sample,  where Surr, Mid, NID and TIN are the physical columns and Seq column values are getting using Row_Number function code which I have shared in first post. There are few more additional columns apart from shown in the below snap so one column named [Met] is there and we want to SUM  the values from column [Met] for Seq=1 like the way we are doing thru sql which can be found in first post.

 

DB.png

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors