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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

SELECTCOLUMNS vs ALL(Column)

Can someone help me understand why these two measure give different results? I would expect that "ALL(Table[Category])" to be equivelent to "SELECTCOLUMNS(ALL(Table), "Category", Table(Category))", however...

Category Rank = 
	RANKX(
		ALL('Table'[Category]) ,
		CALCULATE(
			SUM('Table'[My Value])
			)
	)
Category Rank 2 = RANKX(
                SELECTCOLUMNS(
                    ALL('Table'),
                    "Category",
                    'Table'[Category]),
                CALCULATE(SUM('Table'[My Value]))
            )

Yeilds the following results:

rankxResults.png

 

I expect the same results. I included the count because I noticed the Rank 2's rankings are seperated by the count of records between the two which may provide a clue.

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

Look at my test

8.png

RANK = RANKX(ALL(Sheet4[Category]),CALCULATE(SUM(Sheet4[My Value])))
RANK2 = RANKX(SELECTCOLUMNS(ALL(Sheet4),"category",Sheet4[Category]),CALCULATE(SUM(Sheet4[My Value])))

above two measures are just like yours.

 

In the first measure, ALL(Sheet4[Category]) means to ignore filters in the Sheet4[Category] column, but don't ignore filters on other columns of Sheet4. So the "RANK" should ignore filters in the Sheet4[Category], only consider the "My Value" column.

 

In the second measure,SELECTCOLUMNS(ALL(Sheet4),"category",Sheet4[Category]) just returns a table which has a column "category". it doesn't ignore filters on any column. Thus,"RANK2" should consider "Category" and "My Value" column.

 

By a little modification to the "RANK2", it can get the same result as "RANK".

RANK5 = RANKX(SELECTCOLUMNS(ALL(Sheet4),"category",Sheet4[Category]),CALCULATE(SUM(Sheet4[My Value])),,DESC,Dense)

 

Best Regards

Maggie

 

View solution in original post

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @Anonymous

Look at my test

8.png

RANK = RANKX(ALL(Sheet4[Category]),CALCULATE(SUM(Sheet4[My Value])))
RANK2 = RANKX(SELECTCOLUMNS(ALL(Sheet4),"category",Sheet4[Category]),CALCULATE(SUM(Sheet4[My Value])))

above two measures are just like yours.

 

In the first measure, ALL(Sheet4[Category]) means to ignore filters in the Sheet4[Category] column, but don't ignore filters on other columns of Sheet4. So the "RANK" should ignore filters in the Sheet4[Category], only consider the "My Value" column.

 

In the second measure,SELECTCOLUMNS(ALL(Sheet4),"category",Sheet4[Category]) just returns a table which has a column "category". it doesn't ignore filters on any column. Thus,"RANK2" should consider "Category" and "My Value" column.

 

By a little modification to the "RANK2", it can get the same result as "RANK".

RANK5 = RANKX(SELECTCOLUMNS(ALL(Sheet4),"category",Sheet4[Category]),CALCULATE(SUM(Sheet4[My Value])),,DESC,Dense)

 

Best Regards

Maggie

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors