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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Explico
Frequent Visitor

Need help to create measure for unallocated sales allocation to other categories

Hey. I do have sales data set where part of the sales is "unallocated" i.e. sales department is missing. I need help creating measure, which would allocate  those "unallocated" sales to other available departments proportionally (based on their sales). This is what I do have and what I'm trying to achieve:

Screenshot 2022-05-08 125900.png

Need to play with filters, but that part is still quite confusing for me. Thanks in advance!

1 ACCEPTED SOLUTION
Jos_Woolley
Solution Sage
Solution Sage

Hi,
Assuming you already have a measure named TotalSales, defined as:

Total Sales =
SUM( 'Table'[Sales] )

create the following additional measure:

MyMeasure =
VAR Department =
    MIN( 'Table'[Department] )
VAR SalesUnallocated =
    CALCULATE( [Total Sales], 'Table'[Department] = "Unallocated" )
VAR SalesExcUnallocated =
    CALCULATE( [Total Sales], ALL( 'Table'[Department] ) ) - SalesUnallocated
VAR MyWeight = [Total Sales] / SalesExcUnallocated
VAR AdjustedSales = MyWeight * SalesUnallocated + [Total Sales]
RETURN
    IF( Department = "Unallocated", 0, AdjustedSales )

Regards

View solution in original post

2 REPLIES 2
Jos_Woolley
Solution Sage
Solution Sage

Hi,
Assuming you already have a measure named TotalSales, defined as:

Total Sales =
SUM( 'Table'[Sales] )

create the following additional measure:

MyMeasure =
VAR Department =
    MIN( 'Table'[Department] )
VAR SalesUnallocated =
    CALCULATE( [Total Sales], 'Table'[Department] = "Unallocated" )
VAR SalesExcUnallocated =
    CALCULATE( [Total Sales], ALL( 'Table'[Department] ) ) - SalesUnallocated
VAR MyWeight = [Total Sales] / SalesExcUnallocated
VAR AdjustedSales = MyWeight * SalesUnallocated + [Total Sales]
RETURN
    IF( Department = "Unallocated", 0, AdjustedSales )

Regards

Hi. Thanks @Jos_Woolley ! 

Almost works, but strange behavior with Matrix Total. Any ideas?

Screenshot 2022-05-08 161709.png

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors