This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
I'm sure that there is an easy answer to this one but its alluding me presently and if anybody could shed some light I would be eternally grateful.
I have 3 columns in a table, A, B and C, A contains "Y" or "N", B and C contain numerical values
I want to create a single measure that gives me the total of B and C depending on the value in A, so if A = "Y" I want to include the value in B and if A = "N" I want to include the value in C in the calculation.
I can create 2 measures filtering on each of the conditions and add them up in a 3rd measure and I get the right answer but I feel I ought to be able to do this is a single measure but the syntax alludes me.
Peter
Solved! Go to Solution.
Hi Peter,
See if the below helps you out at all (obviously replacing table and columns names with your own):
Measure = sumx(Table1,if(Table1[A]="Y",(Table1[B]),if(Table1[A]="N",(Table1[C]),0)))
Thanks
Alex
Hi Peter,
See if the below helps you out at all (obviously replacing table and columns names with your own):
Measure = sumx(Table1,if(Table1[A]="Y",(Table1[B]),if(Table1[A]="N",(Table1[C]),0)))
Thanks
Alex
Alex, works perfectly. So simple yet I stuggled with that for hours. Thanks so much for taking your time out to help me. I really appreciate it
Regards
Peter
Glad i could help! 🙂
Check out the May 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 |
|---|---|
| 32 | |
| 25 | |
| 24 | |
| 22 | |
| 13 |
| User | Count |
|---|---|
| 61 | |
| 47 | |
| 27 | |
| 24 | |
| 19 |