- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Doing a rank with a column created in variable
Hi everyone,
I need to rank the Sales of the Employees, but I have a table and a new column called Test created as a variable in th DAX. This is to improve the performance. I have tried it without and it is taking too long to load, so this is my only solution. The loading time is no problem anymore but now I dont know how to iterate through the new column Test to get the ranking right. I need to use that column (which is a replication of the column Sales) because the column Sales is based on a lot of measures, which is the reason why it takes so long to load.
The query is executing but the rankings come out all as 1. It must be due to the SUMX() that just compares every row with itself. How can I fix this?
Your help is gretaly apreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi, @f_r_1998
try below
Measure =
VAR table_ =
ADDCOLUMNS (
SUMMARIZE (
'TableEmployee',
'TableEmployee'[Employee],
"Sales", 'TableSales'[Sales]
),
"Test", [Sales]
)
RETURN
RANKX(table_ ,[test],,ASC,Dense)
or
measure =
rank(
crossjoin(
all('TableEmployee'[Employee]),
all('TableSales'[Sales])
),
orderby([sales],asc)
)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi! Thanks for your reply! The first option is not working because the newly created column and table cannot go just like this in the Rankx. That is why I usd SUMX() but I only get 1s for every row. And the second option is not working either, and also referring to the measure Sales, which is wanted to avoid. Do you have any other suggestions?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
08-12-2019 04:51 AM | |||
07-30-2024 11:51 AM | |||
05-27-2023 01:11 AM | |||
09-03-2024 10:13 AM | |||
01-18-2023 12:11 AM |
User | Count |
---|---|
23 | |
12 | |
10 | |
10 | |
8 |
User | Count |
---|---|
16 | |
15 | |
15 | |
12 | |
10 |