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.
Hello Everyone,
I have a table that has data arranged into main sections and subsections as shown below.
Main Section | Sub Section | Value |
Section A | Sub Section 1 | 10 |
Section A | Sub Section 2 | 9 |
Section A | Sub Section 3 | 21 |
Section B | Sub Section 1 | 22 |
Section B | Sub Section 2 | 75 |
I want create and measure that will show the ratio of the total value of each main section as well as the ratio of its subsections compared to the highest total across all other sections when expanded in a matrix visual.
So far, my measure only shows the ratio of the main section total compared to the maximum total in that table,
how do I ensure that when I expand to the subsections under their parent sections, the ratio calculation persists for each individual value of the subsections.
Solved! Go to Solution.
Hello @BOkungbure,
Can you please try this:
1. Calculate the Maximum Total across all Sections
Max Total Value =
MAXX(
ALL('YourTableName'[Main Section]),
SUMX(
FILTER(
'YourTableName',
'YourTableName'[Main Section] = EARLIER('YourTableName'[Main Section])
),
'YourTableName'[Value]
)
)
2. Calculate the Ratio
Ratio =
VAR MainSectionTotal =
SUMX(
FILTER(
'YourTableName',
'YourTableName'[Main Section] = EARLIER('YourTableName'[Main Section])
),
'YourTableName'[Value]
)
VAR CurrentValue =
IF(
ISINSCOPE('YourTableName'[Sub Section]),
SUM('YourTableName'[Value]),
MainSectionTotal
)
RETURN
DIVIDE(CurrentValue, [Max Total Value])
Should you require any further assistance, feel free to reach out to me.
Thanks Sahir,
This solution was super helpful, ISINSCOPE was the missing piece
Thanks Sahir,
This solution was super helpful, ISINSCOPE was the missing piece
Hello @BOkungbure,
Can you please try this:
1. Calculate the Maximum Total across all Sections
Max Total Value =
MAXX(
ALL('YourTableName'[Main Section]),
SUMX(
FILTER(
'YourTableName',
'YourTableName'[Main Section] = EARLIER('YourTableName'[Main Section])
),
'YourTableName'[Value]
)
)
2. Calculate the Ratio
Ratio =
VAR MainSectionTotal =
SUMX(
FILTER(
'YourTableName',
'YourTableName'[Main Section] = EARLIER('YourTableName'[Main Section])
),
'YourTableName'[Value]
)
VAR CurrentValue =
IF(
ISINSCOPE('YourTableName'[Sub Section]),
SUM('YourTableName'[Value]),
MainSectionTotal
)
RETURN
DIVIDE(CurrentValue, [Max Total Value])
Should you require any further assistance, feel free to reach out to me.
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 |
---|---|
14 | |
11 | |
10 | |
10 | |
10 |
User | Count |
---|---|
16 | |
13 | |
12 | |
11 | |
8 |