March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
25 | |
18 | |
15 | |
9 | |
8 |
User | Count |
---|---|
37 | |
32 | |
21 | |
16 | |
14 |