Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
hello,
I am trying to transform the following Oracle SQL function into DAX but without any success. Could you please help me how to solve it? The functionality of this field should be like that you input account value into ${account} and then it shows you relevant result.
SELECT
sum(CASE
WHEN "accountMD" = ${account} THEN -1*"amount"
ELSE "amount"
END
) OVER (PARTITION BY "businessPartnerNumber") AS SUM
FROM Table
Thank you,
Martin
Solved! Go to Solution.
Hi @Anonymous ,
I created some data:
Table:
Table2:
Here are the steps you can follow:
1. Use [account] of Table2 as a slicer.
2. Create measure.
if_Measure =
var _select=SELECTEDVALUE('Table 2'[account])
return
IF(
MAX('Table'[accountMD])=_select,-1*MAX('Table'[amount]),MAX('Table'[amount]))SUM =
SUMX(FILTER(ALL('Table'),'Table'[businessPartnerNumber]=MAX('Table'[businessPartnerNumber])),[if_Measure])
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous ,
I created some data:
Table:
Table2:
Here are the steps you can follow:
1. Use [account] of Table2 as a slicer.
2. Create measure.
if_Measure =
var _select=SELECTEDVALUE('Table 2'[account])
return
IF(
MAX('Table'[accountMD])=_select,-1*MAX('Table'[amount]),MAX('Table'[amount]))SUM =
SUMX(FILTER(ALL('Table'),'Table'[businessPartnerNumber]=MAX('Table'[businessPartnerNumber])),[if_Measure])
3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 4 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 17 | |
| 8 | |
| 7 | |
| 7 | |
| 6 |