Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be 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

Reply
ccolletti
Helper I
Helper I

Rolling Up Values from Sublevel to Calculate at Higher Levels in Matrix and/or Table Visual

Hi all, and thank you in advance for all your help!

 

I'm working on a report for my company that I was able to get a value down at the store sublevel on if the store reached compliance marking it as a 1 or 0. Now I want to calculate this at the next levels up to a district and regional level. The query I used I found on this thread and works great: https://community.fabric.microsoft.com/t5/Desktop/Only-Total-Select-Values-in-a-Matrix-amp-Formattin... 

 

I've had a hard time finding something that would work in order for me to utilize the data that comes in as the Compliance value at the next levels up. Just shows up as 0.

 

Some example data is below, where Compliance is the value I got from your measure above. I want to calculate those and divide by the total number of stores within it's region. I'd want to eventually get the following results: East - 67%, Central - 33%, West - 50%

RegionStoreReview CountCompliance
East 320
 1201
 250
 371
Central 310
 420
 5151
 6140
West 500
 7331
 8101
 950
 1020

 

Thank you very much for your help!

1 ACCEPTED SOLUTION
v-kaiyue-msft
Community Support
Community Support

Hi @ccolletti ,

 

Since I don't know how your measure Compliance is calculated, I'm assuming Review Count greater than 10 is 1. So the final result is a little different, but the overall logic is the same.

 

You can create the measure.

MEASURE =
VAR _count1 =
COUNTX (
FILTER ( ALLSELECTED ( 'Table'[Store] ), [Compliance] = 1 ),
[Compliance]
)
VAR _count2 =
CALCULATE ( COUNT ( 'Table'[Store] ), ALLSELECTED ( 'Table'[Store] ) )
RETURN
DIVIDE ( _count1, _count2 )


Set it as a percentage.

vkaiyuemsft_0-1723599406913.png

 

vkaiyuemsft_1-1723599414962.png

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
ccolletti
Helper I
Helper I

@v-kaiyue-msft , yes this worked! Thank you so much for your help!

v-kaiyue-msft
Community Support
Community Support

Hi @ccolletti ,

 

Since I don't know how your measure Compliance is calculated, I'm assuming Review Count greater than 10 is 1. So the final result is a little different, but the overall logic is the same.

 

You can create the measure.

MEASURE =
VAR _count1 =
COUNTX (
FILTER ( ALLSELECTED ( 'Table'[Store] ), [Compliance] = 1 ),
[Compliance]
)
VAR _count2 =
CALCULATE ( COUNT ( 'Table'[Store] ), ALLSELECTED ( 'Table'[Store] ) )
RETURN
DIVIDE ( _count1, _count2 )


Set it as a percentage.

vkaiyuemsft_0-1723599406913.png

 

vkaiyuemsft_1-1723599414962.png

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.