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
I'm currently building a matrix visual where I'm using two tables given below (trending table and waterfall_switch_table) as a basis to switch to required variable using the following measure.
Trending Measure =
VAR B1 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[B1]
)
)
VAR B2 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[B2]
)
)
VAR B3 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[B3]
)
)
VAR B4 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[B4]
)
)
VAR B5 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[B5]
)
)
VAR B6 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[B6]
)
)
VAR B7 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[B7]
)
)
VAR B8 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[B8]
)
)
VAR B9 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[B9]
)
)
VAR B10 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[B10]
)
)
VAR B11 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[B11]
)
)
VAR B12 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[B12]
)
)
VAR B13 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[B13]
)
)
VAR A1 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[A1]
)
)
VAR A5 =
CALCULATE(
SUM(
'Bridge Table (CMA05 - Budgetvolume)'[A2]
)
)
VAR A2 =
B1 + B2 + B3 + B4 + B5 + B6 + B7
VAR A3 =
B8 + B9 + B10
VAR A4 =
B11 + B12 + B13
RETURN
IF(
ISINSCOPE(Trending[Sub var]),
SWITCH (
SELECTEDVALUE( Trending[ID] ),
1, B1,
2, B2,
3, B3,
4, B4,
5, B5,
6, B6,
7, B7,
8, B8,
9, B9,
10, B10,
11, B11,
12, B12,
13, B13
),
SWITCH (
SELECTEDVALUE( Waterfall_SwitchTable[ID] ),
1, A1,
2, A2,
3, A3,
4, A4,
5, A5
)
)
This produces the following matrix, where the values are shown when expanded to level B. But consequently all level A values are hidden and will only be shown when the table is fully collapsed. I've been trying to combine these two switch functions, but haven't been able to unfortunately. Could someone steer me into the right direction to make this work?
Expanded:
Collapsed:
Trending table:
Waterfall_Switch_table:
Sample data - Budgetvolume table:
A1 | A5 | B1 | B2 | B3 | B4 | B5 | B6 | B7 | B8 | B9 | B10 | B11 | B12 | B13 |
20 | 30 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
20 | 30 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
20 | 30 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
20 | 30 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
20 | 30 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
20 | 30 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
Solved! Go to Solution.
IF(
ISINSCOPE(Trending[Sub measure]),
Measures are never in scope.
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Thank you for the feedback, in hindsight I see I didn't provide enough information. I changed the naming of all variables, tables, measures and values. So nothing is blacked out anymore and the entire measure is now visible.
Related to your reply regarding measures not being in scope. That would be correct, but I named the column a bit vaguely as it is not referring to a measure but the names of the variables. The provided value within
IF(
ISINSCOPE(Trending[Sub var]),
refers to a table[column] reference, so that shouldn't be the issue here
Maybe you just need to re-enable row totals?
O I feel kind of stupid now, I was trying to make the solution way too complicated. Thank you, that was it
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 |
---|---|
134 | |
91 | |
89 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |