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.
TABLE1 | ||
EMP NO | COMPONENT | PAY |
EM0001 | BASIC | 5000 |
EM0001 | HRA | 300 |
EM0001 | TRNSPORT | 500 |
EM0001 | AIR TICKET | |
EM0002 | BASIC | 7000 |
EM0002 | HRA | 300 |
EM0002 | TRNSPORT | 500 |
EM0002 | AIR TICKET |
TABLE2 | ||
EMP NO | SECTOR ID | NO OF TICKET |
EM0001 | SEC-001 | 2 |
EM0002 | SEC-002 | 1 |
EM0003 | SEC-001 | 3 |
TABLE 3 | |
SECTOR ID | TICKET FAIR |
SEC-001 | 2500 |
SEC-002 | 6000 |
SEC-003 | 1500 |
I need to calculate air ticket amount based on no off ticket, like EM001 =PAY =2*2500 =5000
EM002 = 1*6000
TABLE1 | ||
EMP NO | COMPONENT | PAY |
EM0001 | BASIC | 5000 |
EM0001 | HRA | 300 |
EM0001 | TRNSPORT | 500 |
EM0001 | AIR TICKET | 5000 |
EM0002 | BASIC | 7000 |
EM0002 | HRA | 300 |
EM0002 | TRNSPORT | 500 |
EM0002 | AIR TICKET | 6000 |
Solved! Go to Solution.
Since it looks like you're trying to add values into the existing Table1, I recommend that you do this work in Query Editor as opposed to DAX.
I propose the following method:
If you have above relationships, you can add a calculated column in Table1
Revised Pay = IF ( Table1[COMPONENT] = "Air Ticket", RELATED ( Table2[NO OF TICKET] ) * RELATED ( Table3[TICKET FAIR] ), Table1[PAY] )
Since it looks like you're trying to add values into the existing Table1, I recommend that you do this work in Query Editor as opposed to DAX.
I propose the following method:
I believe the 3 tables would have a relationship like this.
If you have above relationships, you can add a calculated column in Table1
Revised Pay = IF ( Table1[COMPONENT] = "Air Ticket", RELATED ( Table2[NO OF TICKET] ) * RELATED ( Table3[TICKET FAIR] ), Table1[PAY] )
Thanks Zubair, Its worked.