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.
Hello,
I need to avoid the filter context apllied by the columns of a matrix in order to calculate the total for the full year instead just one month for a particular product.
I have a month table that has a many to one relation with a date table that has a many to one relation with a fact table.
Then I have a product table that is link to the fact table as well.
The formula that I use is this: CALCULATE([Sold],filter(Product,Product[Index]=7),ALLSELECTED(DatesKeyMonths[Month]))
sold is a countrows of factTable
The result should be 2, instead of one, 1 product was sold each month
Solved! Go to Solution.
Based on your explanation, it sounds like you want to ignore the filter context applied by the columns of a matrix visual while still keeping the context from the rows above. To achieve this, you can use the ALLEXCEPT function to remove the filter context for all columns except for the DatesKeyMonths[Month] column, which will be preserved by the ALLSELECTED function.
Here's the modified formula:
This formula uses the FILTER function to filter the Product table for the product with an index of 7. The ALLEXCEPT function is then used to remove the filter context for all columns in the visual except for the DatesKeyMonths[Month] column. Finally, the ALLSELECTED function is used to preserve the filter context for the DatesKeyMonths[Month] column.
By using ALLEXCEPT instead of ALLSELECTED to remove the filter context for all columns except for the DatesKeyMonths[Month] column, you can preserve the filter context from the rows above in the matrix visual. This should give you the result of 2, which is the total number of products sold for the entire year, instead of 1 for a single month.
Based on your explanation, it sounds like you want to ignore the filter context applied by the columns of a matrix visual while still keeping the context from the rows above. To achieve this, you can use the ALLEXCEPT function to remove the filter context for all columns except for the DatesKeyMonths[Month] column, which will be preserved by the ALLSELECTED function.
Here's the modified formula:
This formula uses the FILTER function to filter the Product table for the product with an index of 7. The ALLEXCEPT function is then used to remove the filter context for all columns in the visual except for the DatesKeyMonths[Month] column. Finally, the ALLSELECTED function is used to preserve the filter context for the DatesKeyMonths[Month] column.
By using ALLEXCEPT instead of ALLSELECTED to remove the filter context for all columns except for the DatesKeyMonths[Month] column, you can preserve the filter context from the rows above in the matrix visual. This should give you the result of 2, which is the total number of products sold for the entire year, instead of 1 for a single month.
That worked thanks a lot.
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 |
---|---|
17 | |
7 | |
7 | |
6 | |
5 |
User | Count |
---|---|
22 | |
10 | |
10 | |
9 | |
7 |