The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi guys,
I have a question around ISINSCOPE formula.
Lets say i have a Table1 with Column "Value" as a whole number.
Table also has a column called Type.
e.g.
Type / Value
Ben / 6
Ben / 12
John / 6
I create a measure using isinscope, to sum Values based on Type (only at type level) using ISINSCOPE:
Measure1 =
if(ISINSCOPE('Table'[Type]),
sum('Table'[Value]),
blank)
This measure will return blank at Row total level if we have a matrix with Types in rows and measure as values.
Now I'd like to create a 2nd measure that would reference to a 1st measure at Type level and calculate all Values for Ben.
Measure2 =
calculate([Measure1],
filter('Table','Table'[Type]="Ben"))
Such measure returns blank because Measure1 has ISINSCOPE formula.
Question: how can i specify in Measure2 to which hierarchy to go to apply the desired filter in order to obtain Values for Type = BEN ?
Thank you
ISINSCOPE works only when the column under it is a grouping column in a visual (SUMMARIZECOLUMNS). If you're creating a measure that is to be used in another, then this is useless because you're not grouping by anything since you can't use SUMMARIZECOLUMNS in a measure. Usually, you should in such cases use HASONEVALUE instead. Measures with ISINSCOPE should only ever be use as top-level measures, not sub-measures. The same is true for measures which contain the function ALLSELECTED.
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
19 | |
12 | |
9 | |
5 |