Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet 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
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.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
86 | |
82 | |
70 | |
49 |
User | Count |
---|---|
143 | |
123 | |
107 | |
61 | |
55 |