Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
What is an equivalent DAX measure for the following SQL query:
select sum(amount) from (select distinct srcid, amount from mytable where datanameshort='name' and status = 'status');
Hi @MDR ,
Try this.
SUMX (
SUM( 'Table'[Amount] ),
CALCULATE ( DISTINCT ( 'Table'[Scrid] ) , 'Table'[datanameshort]='name' and 'Table'[status] = 'status)
)
Thanks,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
Proud to be a Super User!
Thanks @pratyashasamal this returns the following error:
The SUMX function expects a table expression for argument '1', but a string or numeric expression was used.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
93 | |
89 | |
35 | |
35 |
User | Count |
---|---|
154 | |
102 | |
82 | |
64 | |
54 |