Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
I have a data set in which I need to tag resources used in a session, starting from 1. I am attaching an image for a sample of my data set. Please help me...
Solved! Go to Solution.
Check if RANKX Function works.
Rank =
RANKX (
FILTER ( Table1, Table1[Session ID] = EARLIER ( Table1[Session ID] ) ),
Table1[Start Time],
,
ASC,
SKIP
)
You may use the following DAX to add a calculated column.
Flag =
IF (
MAXX (
TOPN (
1,
FILTER ( Table1, Table1[Session ID] = EARLIER ( Table1[Session ID] ) ),
Table1[Start Time], ASC
),
Table1[Resource]
)
= 1,
1,
0
)
There is one slight error, that my session id's are in alpha numeric and so the format its format is text. And when I am using your suggested formula the following error is shown:
DAX comparison operations do not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.
I tried formatting it using format and value function but to no avail.
Simply change it to VALUE ( Table1[Resource] ) or = "1".
Sorry, but I did not understand. Could you explain it again.
And my session id's are in the alpha numeric format, not my resources ids.
The data type of session id doesn't matter in formula above. Share the .pbix file if convenient.
Can you rewrite the formula, because did run successfully but it's resulting in only 0? I am attaching an image.
It works for your original sample data. You may need to check the actual data and change it accordingly. Better to learn more DAX basics before going ahead.
The formula didn't work on my sample data set also.
Please show us expected result based on your sample data.
Some thing like this:
Aren't there any commands like "Tag" found in stata for power bi.
Check if RANKX Function works.
Rank =
RANKX (
FILTER ( Table1, Table1[Session ID] = EARLIER ( Table1[Session ID] ) ),
Table1[Start Time],
,
ASC,
SKIP
)
And my session id's are in the alpha numeric format, not my resources ids.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 21 | |
| 17 | |
| 14 |
| User | Count |
|---|---|
| 58 | |
| 50 | |
| 37 | |
| 29 | |
| 24 |