This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi Team,
I need DAX for below logic.
I have two tables 1. invoice 2.policy
Invoice table:
| Inv No | Role | Polid |
| INV1 | Executive | Pol1 |
| INV2 | Reprtesentative | Pol2 |
Policy Table:
| Polid | Primary |
| Pol1 | Y |
| Pol2 | N |
I am expecting below result
like : If primary flag is “Y” for any rep/exec, show Rep – primary or Exec – primary and if flag is “N”, show Rep – additional or Exec – additional.
| polid | invno | Role |
| Pol1 | Inv1 | Exe - Primary |
| Pol2 | Inv2 | Rep- additional |
Thanks in Advance.
Solved! Go to Solution.
@RadhakrishnaE - Follow the below steps:
Step 1: First create a relation between both thos tables using Policy ID.
Step 2: Then create a new calculated column like below:
@RadhakrishnaE - Follow the below steps:
Step 1: First create a relation between both thos tables using Policy ID.
Step 2: Then create a new calculated column like below:
Hey @RadhakrishnaE ,
I guess the two tables are connected with a relationship. If that's the case, the following measure should do it:
RoleNew =
IF(
MAX( Policy[Primary] ) = "Y",
"Rep – primary",
"Rep – additional"
)
Here I check if the Primary is "Y" and if yes return "primary", otherwise "additional".
@RadhakrishnaE , a new column like
new column =
var _1 = maxx(filter(Table2, Table1[polid] = table2[polid]),Table2[primary])
Var _2 = if(_1 ="Y", "Primary", "Additional")
return
left([Role],3) & " " & _2
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 24 | |
| 23 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 36 | |
| 30 | |
| 22 | |
| 22 |