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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hello,
something I don't understand.
I want count a if statement with two columns.
What I want is the Sum of Test. I'll tried this.
But I'll get an error if i want show it together with AccountId.
Is there somebody who could explain me this behaviour of DAX 🙂 ?
I don't understand why I can't use AccountId with this measure.
Thanks and take care,
Anna
Solved! Go to Solution.
Hi @AnnaAliera18 ,
Please try:
test = SUMX(ADDCOLUMNS('Table',"SUM",IF([Column1]>0&&[Column2]>0,1,0)),[SUM])
Output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @AnnaAliera18 ,
Please try:
test = SUMX(ADDCOLUMNS('Table',"SUM",IF([Column1]>0&&[Column2]>0,1,0)),[SUM])
Output:
Best Regards,
Jianbo Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@AnnaAliera18 , Use summarize with Addcolumns
test2 = var table1 = Addcolumns(Summarize('Table', 'Table'[AccountID]) ,"Sum",if(sum('Table'[Column1]) >0 && sum('Table'[Column2])>0,1,0))
return sumx(table1,[Sum])
Thanks the error is gone but the calculation is wrong.
the Total gets 5
how I can get 3 in my total?
What I want is sum the 1 in the column. If I use a physical table it works fine, but i want use a VAR and only one measure if it works.
Thanks for your help 🙂
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 53 | |
| 40 | |
| 17 | |
| 16 |
| User | Count |
|---|---|
| 117 | |
| 107 | |
| 42 | |
| 32 | |
| 26 |