Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
HI! so I am trying to use the isinscopre function in a matrix to show different transaction count values based on the hierarchy of Event Name -> Offer ID -> SKU. My measure works fine to switch teh values betweek sku and offer, but for osme reason it's showing the total sum of ALL events and not just the associated event. I'm wondering if it's something wrong with my model?
Below is the measure
So from left to right, this is my transactions measure, the count for the event, the count for teh offers for that event (one offer in this example), and the count for differnet sku products.
Looking across the rows, it works fine except for that event, which is showing the sum of total counts for all. The event, sku,and offer tables are connected with unique keys, and there are unique values of the event id, so i'm not sure why this isn't calulating correctly. Is there a way to just not use Sum at all in my measure, and have it display the correct associated count? Thanks!
Solved! Go to Solution.
HI @alaynanich,
After using filter to check the current row contents level, you also need to add correspond filters to these expressions to control calculate the result instead directly use aggregate functions(e.g. sum, average, average) to implicit calculation.
TY Transactions =
VAR sku =
CALCULATE (
SUM ( 'Consolidated SKU Sales'[Total transactions] ),
ALLSELECTED ( 'Consolidated SKU Sales' ),
VALUES ( 'Consolidated SKU Sales'[SKU] )
)
VAR offer =
CALCULATE (
SUM ( 'Consolidated Offer'[ty trans count] ),
ALLSELECTED ( 'Consolidated SKU Sales' ),
VALUES ( 'Consolidated SKU Sales'[SKU] ),
VALUES ( 'Consolidated SKU Sales'[Offer Name Tx] )
)
VAR event =
CALCULATE (
SUM ( 'Consolidated Events'[ty trans count] ),
ALLSELECTED ( 'Consolidated SKU Sales' ),
VALUES ( 'Consolidated SKU Sales'[SKU] ),
VALUES ( 'Consolidated SKU Sales'[Offer Name Tx] ),
VALUES ( 'Consolidated SKU Sales'[Event Nm] )
)
RETURN
IF (
ISINSCOPE ( 'Consolidated SKU Sales'[SKU] ),
sku,
IF (
ISINSCOPE ( 'Consolidated SKU Sales'[Offer Name Tx] ),
offer,
IF ( ISINSCOPE ( 'Consolidated SKU Sales'[Event Nm] ), event )
)
)
Regards,
Xiaoxin Sheng
@Anonymous thank you!! that worked like a charm!
HI @alaynanich,
After using filter to check the current row contents level, you also need to add correspond filters to these expressions to control calculate the result instead directly use aggregate functions(e.g. sum, average, average) to implicit calculation.
TY Transactions =
VAR sku =
CALCULATE (
SUM ( 'Consolidated SKU Sales'[Total transactions] ),
ALLSELECTED ( 'Consolidated SKU Sales' ),
VALUES ( 'Consolidated SKU Sales'[SKU] )
)
VAR offer =
CALCULATE (
SUM ( 'Consolidated Offer'[ty trans count] ),
ALLSELECTED ( 'Consolidated SKU Sales' ),
VALUES ( 'Consolidated SKU Sales'[SKU] ),
VALUES ( 'Consolidated SKU Sales'[Offer Name Tx] )
)
VAR event =
CALCULATE (
SUM ( 'Consolidated Events'[ty trans count] ),
ALLSELECTED ( 'Consolidated SKU Sales' ),
VALUES ( 'Consolidated SKU Sales'[SKU] ),
VALUES ( 'Consolidated SKU Sales'[Offer Name Tx] ),
VALUES ( 'Consolidated SKU Sales'[Event Nm] )
)
RETURN
IF (
ISINSCOPE ( 'Consolidated SKU Sales'[SKU] ),
sku,
IF (
ISINSCOPE ( 'Consolidated SKU Sales'[Offer Name Tx] ),
offer,
IF ( ISINSCOPE ( 'Consolidated SKU Sales'[Event Nm] ), event )
)
)
Regards,
Xiaoxin Sheng
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
8 | |
8 | |
8 |
User | Count |
---|---|
13 | |
12 | |
11 | |
10 | |
9 |