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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
hamishpolson
Regular Visitor

ALLEXCEPT not working

I am trying to remove row context of specific columns. I am trying to return a % of total sales relevent to a specific sales channel for each product. In otherwords every product when viewed across each channel would total 100%. To do this I am creating a VAR totalSales which should calculate total sales for each product across total market. However my current result is giving me a % of total sales for all products and all markets.

 

I would really appreciate anyone who can try and help point me in the right direction as I have not been able to solve this for the last few days!

 

 Channel AChannel B
Brand A65%35%
Product A50%50%

Product B

40%60%

Product C

70%30%

 

 

Dol SOT CY = 
VAR totalSales = 
    calculate(
        SUM(Data[Dollars]),
        ALLEXCEPT(Data,Data[Product])
        )
           
Var sales = SUM(Data[Dollars])
   
 Return
    sales/totalSales

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Probably something like this:

[Total] = SUM( Data[Dollars] )

[Dol SOT CY] = 
VAR __totalAcrossMarkets = 
    CALCULATE(
        [Total],
		VALUES( Data[Product] ),
		ALL( Data )
	)    
VAR __currentTotal = [Total]
VAR __result =
	DIVIDE( __total, __totalAcrossMarkets )
RETURN
	__result

 

Best

D

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

By the way... ALLEXCEPT is a very dangerous function. To know when to use it you have to study it in great depth.

Best
D
Anonymous
Not applicable

Probably something like this:

[Total] = SUM( Data[Dollars] )

[Dol SOT CY] = 
VAR __totalAcrossMarkets = 
    CALCULATE(
        [Total],
		VALUES( Data[Product] ),
		ALL( Data )
	)    
VAR __currentTotal = [Total]
VAR __result =
	DIVIDE( __total, __totalAcrossMarkets )
RETURN
	__result

 

Best

D

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.