Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi all,
I need help...I have following table
Document type | Amount |
document 1 | 10 |
document 2 | 20 |
document 3 | 30 |
document 1 | 10 |
document 2 | 20 |
document 3 | 30 |
and I need get sum only for Document Type="document 2", so result should be this
Document type | Amount |
document 1 | |
document 2 | 40 |
document 3 |
I have this formula
measure= CALCULATE( SUM(Table[Amount);
Document type | Amount |
1 | 40 |
2 | 40 |
3 | 40 |
Any idea WHY (please SIMPLE describe the logic if possible )?! Even when I do SUM only for document 2 context (filtrex context)
Solved! Go to Solution.
With the ALL-function, you are saying ignore all filters on the [document type]-column. So if you have a table with [document type] in it, the measure pays no respect to these. And since you after the ALL-function add a filter on [document type]="document 2", this is the only filter on [document type] you measure sees, so it will repeat that number for all document types.
You can change you dax code to this:
CALCULATE(SUM(Table[Amount]);FILTER(Table;Table[Document type]="document 2"))
The question you are asking conserns the filter context of the DAX language, which is an important concept in DAX. I highly recommend doing a DAX course, or buying one of the books which have published recently. It will make Power BI a more powerfull tool for you if you know the concepts of DAX.
With the ALL-function, you are saying ignore all filters on the [document type]-column. So if you have a table with [document type] in it, the measure pays no respect to these. And since you after the ALL-function add a filter on [document type]="document 2", this is the only filter on [document type] you measure sees, so it will repeat that number for all document types.
You can change you dax code to this:
CALCULATE(SUM(Table[Amount]);FILTER(Table;Table[Document type]="document 2"))
The question you are asking conserns the filter context of the DAX language, which is an important concept in DAX. I highly recommend doing a DAX course, or buying one of the books which have published recently. It will make Power BI a more powerfull tool for you if you know the concepts of DAX.
Hi,
many thanks for response 🙂
I have a 'ultimate guide to dax' and studied contexts (but it is hard to use to context correctly, understanding of written formula is OK for me), but when I not use ALL in my formula I see the same value everywhere like with ALL function
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |