Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all,
i have a below query sum up the category wise value, but the DAX is not giving the correct results.
L2_L5_Sum =
var P=SELECTEDVALUE('Calander'[Year])
var a=CALCULATE(SUM('tbl'[Value]),'tbl'[Category]="L2")
var b=CALCULATE(SUM('tbl'[Value]),'tbl[ategory]="L3")
var c=CALCULATE(SUM('tbl'[Value]),'tbl'[Category]="L5",'Calander'[Year]=P)
var x=a+b+c
Return
x
Any suggestion would be fine.
Solved! Go to Solution.
Hi @rajuctech,
You may try this Measure.
SumOfVal = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Category] IN {"L2","L3","L4","L5"}))
The result looks like this.
Also, attached the pbix file as reference.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Hi @rajuctech,
You may try this Measure.
SumOfVal = CALCULATE(SUM('Table'[Value]),FILTER('Table','Table'[Category] IN {"L2","L3","L4","L5"}))
The result looks like this.
Also, attached the pbix file as reference.
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please let me know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Thank you very much msft, it's working fine.
the above one is not working, sumx(table and Expression only)
try this then:
CALCULATE ( SUM( 'Table '[ValueS] ), FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Category ] = MAX ( 'Table'[Category ] && [Category ="L2") ) )
try sumx
var a=CALCULATE(SUMX('tbl'[Category], [Values]),'tbl'[Category]="L2")
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 17 | |
| 9 | |
| 7 | |
| 6 |