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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I have a dataset with two columns. If the "Priority" column has a value of 1, it should be changed to any other number, for example, if it's changed to 3, then 1 will be changed to 3, and 3 will be changed to 1. I have attached a sample data with the desired output.
TASKNO PRIORITY
1 1
2 2
3 3
4 4
5 5
IF PRIORITY ORDER IF I CHANGE 1 TO 5 .. I WANT OUTPUT LIKE
TASKNO PRIORITY TO CHANGE
1 1 5
2 2 2
3 3 3
4 4 4
5 5 1
IF PRIORITY ORDER IF I CHANGE 1 TO 3 .. I WANT OUTPUT LIKE
TASKNO PRIORITY TO CHANGE
1 1 3
2 2 2
3 3 1
4 4 4
5 5 5
IF PRIORITY ORDER IF I CHANGE 1 TO 4 .. I WANT OUTPUT LIKE
TASKNO PRIORITY TO CHANGE
1 1 4
2 2 2
3 3 3
4 4 1
5 5 5 Thanks in advance .
Hi @Anonymous ,
You can try the measure:
TO CHANGE =
VAR _priority =
SELECTEDVALUE ( priority[PRIORITY] )
VAR _priorityToChange =
SELECTEDVALUE ( 'table'[PRIORITY] )
RETURN
SWITCH ( _priorityToChange, 1, _priority, _priority, 1, _priorityToChange )
Out of curiosity, what's the real life usage?
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.
Check out my latest demo report in the data story gallery.
Stand with Ukraine!
Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/
Thank you!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 21 | |
| 10 | |
| 9 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 32 | |
| 31 | |
| 20 | |
| 12 | |
| 12 |