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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JimSales81
Helper I
Helper I

Dynamic Measure showing Percent of Location and Region

Hello,


I want to calculate a dynamic measure that shows an idividual's sales as a % of her Store's Sales and a separate measure that shows her Sales as a % of her Region's sales. 

 

Total Sales=Sum('FACT Sales'[Amount])

 

Everytime i try to use ALL or AllExcept on the Store # or Region, i get 100% instead of the desired %.

 

Thanks!

 

 

 

Power BI Example.JPG

Thanks!

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @JimSales81 

 

You can try the following methods.
Measure:

Store Sales = 
VAR _N1 =
    CALCULATE ([Total Sales],
        FILTER ( ALL ( 'FACT Sales' ),
            RELATED ( 'DIM Sales Person'[Store] ) = MAX ( 'DIM Store'[Store#] ) ) )
RETURN
    IF ( NOT ( ISBLANK ( [Total Sales] ) ), _N1 )
Region Sales = 
VAR _N1 =
    CALCULATE ([Total Sales],
        FILTER ( ALL ( 'FACT Sales' ),
            RELATED ( 'DIM Store'[Region] ) = MAX ( 'DIM Store'[Region] ) ) )
RETURN
    IF ( NOT ( ISBLANK ( [Total Sales] ) ), _N1 )
% of Store Sales = DIVIDE([Total Sales],[Store Sales])
% of Region Sales = DIVIDE([Total Sales],[Region Sales])

vzhangti_0-1679032702353.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

 

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @JimSales81 

 

You can try the following methods.
Measure:

Store Sales = 
VAR _N1 =
    CALCULATE ([Total Sales],
        FILTER ( ALL ( 'FACT Sales' ),
            RELATED ( 'DIM Sales Person'[Store] ) = MAX ( 'DIM Store'[Store#] ) ) )
RETURN
    IF ( NOT ( ISBLANK ( [Total Sales] ) ), _N1 )
Region Sales = 
VAR _N1 =
    CALCULATE ([Total Sales],
        FILTER ( ALL ( 'FACT Sales' ),
            RELATED ( 'DIM Store'[Region] ) = MAX ( 'DIM Store'[Region] ) ) )
RETURN
    IF ( NOT ( ISBLANK ( [Total Sales] ) ), _N1 )
% of Store Sales = DIVIDE([Total Sales],[Store Sales])
% of Region Sales = DIVIDE([Total Sales],[Region Sales])

vzhangti_0-1679032702353.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

 

amitchandak
Super User
Super User

@JimSales81 , try like

 

% Sales=divide(Sum('FACT Sales'[Amount]), calculate(Sum('FACT Sales'[Amount]), allexcept(Sales, 'Dim Region'[Region]) ) )

 

% Sales=divide(Sum('FACT Sales'[Amount]), calculate(Sum('FACT Sales'[Amount]), allexcept(Sales, 'Dim Region'[Region]) ) )

 

% Sales=divide(Sum('FACT Sales'[Amount]), calculate(Sum('FACT Sales'[Amount]), allexcept(Sales, 'Dim Store'[Store]) ) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Amit,


Thank you but both are still coming up with 100% for everyone.  how does the filter context know which region/store to tie to any individual in your measures? 

 

THanks,
Jim

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.