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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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