Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello,
I want to add a column(ID) in Power BI query editor same like I have added it in Excel using IF function. See picture below.
column(user_id) should be sorted out low to high.
Solved! Go to Solution.
@hello_MTC is it ok if it will be in dax? You basically need a ranking column there.
If yes, then you just want to write this calculated column:
CALC = RANKX('Table', 'Table'[user_id],,ASC,Dense)
I added a sample with differnet numbers:
Never mind! I solved it!
What if I want to put filter on column(user_type)?
Yes, I have user_type as Suspect, Witness Victim. And I want to filter this out by Victim only.
@hello_MTC can you maybe share a sample data so I could copy it to Power BI and send back the result?
how to share
@hello_MTC either you share a sample PBIX (through a link from onedrive/gdrive/dropbox/etc or just create a sample data in excel and copy paste the table to the message here.
Never mind! I solved it!
@hello_MTC Great! 🙂
Will appreciate your kudos on my messages :))
P.S. Check out my showcase report - got some high level stuff there. Sure you will find there a lot of cool ideas.
https://community.powerbi.com/t5/Data-Stories-Gallery/SpartaBI-Feat-Contoso-100K/td-p/2449543
Give it a thumbs up over there if you liked it 🙂
@hello_MTC is it ok if it will be in dax? You basically need a ranking column there.
If yes, then you just want to write this calculated column:
CALC = RANKX('Table', 'Table'[user_id],,ASC,Dense)
I added a sample with differnet numbers:
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.