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!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Dear Team,
In DAX calculation, I found one weird case, just wanted to filter the data on some condition.
Here is the DAX that was written -
CALCULATE(SUM(FactTotal[Sales]), FILTER(FactTotal, FactTotal[Key] = 1))
It was returning incorrect data.
But when I changed this to different DAX without FILTER word -
CALCULATE(SUM(FactTotal[Sales]), FactTotal[Key] = 1)
It works fine.
Could anyone please suggest, what went wrong with the first statement.
Thanks,
Solved! Go to Solution.
It's the way DAX works internally. Your second function:
CALCULATE(SUM(FactTotal[Sales]), FactTotal[Key] = 1)
is really
CALCULATE(
SUM( FactTotal[Sales]),
FILTER(
ALL(FactTotal),
FactTotal[Key] = 1
)
)so all removes the current filters and applies you FactTotal[Key] = 1 filter.
It's the way DAX works internally. Your second function:
CALCULATE(SUM(FactTotal[Sales]), FactTotal[Key] = 1)
is really
CALCULATE(
SUM( FactTotal[Sales]),
FILTER(
ALL(FactTotal),
FactTotal[Key] = 1
)
)so all removes the current filters and applies you FactTotal[Key] = 1 filter.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 42 | |
| 41 | |
| 21 | |
| 21 |
| User | Count |
|---|---|
| 150 | |
| 106 | |
| 65 | |
| 36 | |
| 36 |