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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Meiko
Helper I
Helper I

Compare Rows

Hi all,

 

I have the a table called "Plan" which looks like this:

ResourceNameDateTaskTotal Capacity Per Month
A1 January, 2022A147
A1 February, 2022B147
B1 March, 2022D161
B1 March, 2022A161
B1 March, 2022C161
C1 April, 2022A140
C1 April, 2022B140
C1 May, 2022C154
D1 May, 2022D154
E1 May, 2022B154

 

I am trying to add a column to it for unique capacity per month for each resource. So I am looking to have something like this:

ResourceNameDateTaskTotal Capacity Per MonthUnique Capacity Per Month
A1 January, 2022A147147
A1 February, 2022B147147
B1 March, 2022D161161
B1 March, 2022A1610
B1 March, 2022C1610
C1 April, 2022A140140
C1 April, 2022B1400
C1 May, 2022C154154
D1 May, 2022D154154
E1 May, 2022B154154

 

Thank you in advance for your help,

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Meiko ,  You need an index column for that. Add that in power query

new column in dax

if( [Index] = minx(filter(Table, [resourcename] = earlier([resourcename]) && [Date] = earlier([date]) ), [Index] ) ,[Total capacity per monnth], 0) 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

Thanks for this, but I am having a problem getting the index. I tried:

Index 1 = RANKX(Plan,Plan[Date],,ASC,Dense)
 
Grand Index = RANKX (
Plan,
Plan[Index 1]
+ RANKX ( Plan, Plan[ResourceName],, ASC, DENSE )
* MAX ( Plan[Index 1] ),
,
ASC,
DENSE
)
but because I dont have unique names or dates I can get a unique number for each row.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Meiko ,  You need an index column for that. Add that in power query

new column in dax

if( [Index] = minx(filter(Table, [resourcename] = earlier([resourcename]) && [Date] = earlier([date]) ), [Index] ) ,[Total capacity per monnth], 0) 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thanks for this, but I am having a problem getting the index. I tried:

Index 1 = RANKX(Plan,Plan[Date],,ASC,Dense)
 
Grand Index = RANKX (
Plan,
Plan[Index 1]
+ RANKX ( Plan, Plan[ResourceName],, ASC, DENSE )
* MAX ( Plan[Index 1] ),
,
ASC,
DENSE
)
but because I dont have unique names or dates I can get a unique number for each row.

Instead of using DAX I just added the index in query and it worked.

Thanks

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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