The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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!
User | Count |
---|---|
28 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |