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 dateJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I have the following matix. I am trying to create a column which shows the total amount of a specific product produced at the Ship To location. In this case MEH and OX.
The SKU column shows the quantity that has been shipped from Cape to the respective site. In the "Site Produces" column I want to display specifically how much the respective Ship To location produces of the SKU. The way I have it showing in the image below is by using the Calculate function to filter by the site OX.
The function is as follows:
OX Produces = CALCULATE ( SUM ( 'table'[SKU_quantity] ), ALLEXCEPT('table','table'[prod_name]), 'table'[Ship To] = "OX")
This does what I need but only for the OX site. Is it possible to have this function change within the matrix for each specific Ship To location, for example, when I expand to MEH, I will see the "Site Produces" value for MEH?
Thanks in advance!
@Anonymous - So normally you would create a VAR __shipto = MAX('Table'[Ship to]) and you would use that in your filter.
If that does not help, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882
Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.
@Greg_Deckler Is this supposed to be a filter in the CALCULATE function?
I tried the follwing:
_Site Produces = CALCULATE (SUM('table'[SKU_quantity]),ALLEXCEPT('table','table'[prod_name]),[_Var_ShipTo])
This gives me the error "A function 'CALCULATE' has been used in a True/False expression that is used as a table filter expression. This is not allowed."
@Anonymous - I guess I was thinking:
OX Produces = CALCULATE ( SUM ( 'table'[SKU_quantity] ), ALLEXCEPT('table','table'[prod_name]), 'table'[Ship To] = Var_Ship_To)
I don't tend to use CALCULATE.
Hi @Anonymous ,
See if this works.
Produces = CALCULATE ( SUM ( 'table'[SKU_quantity] ), ALLEXCEPT('table','table'[prod_name])
The filter context should work for each shipto site.
Regards,
Harsh Nathani
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 |
---|---|
23 | |
11 | |
10 | |
9 | |
8 |