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
david_MAS
Frequent Visitor

DAX: Divide by sum of multiple options

Hi,

 

I'm trying to write a calculate function comvbined with divide that should output a percentage.

 

Background: I have a measure which is grouped by a field called "Channel" which has 8 categories within it.

What I want is to get the proportion of the measure where the Channel used is the combined total of 3 specified channels but i'm getting an error (copied below the code).

% actual  Delivery = 
CALCULATE(
    DIVIDE(
        [Volumes (by Month)],
        ([Volumes (by Month)]
        ('1819 transposed'[Channel ] && "F2F" && "Online" && "Tel"))
                ))

See code above - think there's something obvious I'm missing but any help greatly appreciated:

 

Error Message:
MdxScript(Model) (98, 10) Calculation error in measure '1819 transposed'[% actual Delivery]: Cannot convert value 'Pending' of type Text to type True/False.

 

 

 

 

1 ACCEPTED SOLUTION

Hi @david_MAS ,

 

Please refer to below measures:

Sum certain channel =
CALCULATE (
    SUM ( '1819 transposed'[Volume] ),
    FILTER (
        ALLSELECTED ( '1819 transposed' ),
        '1819 transposed'[Channel] IN { "F2f", "Tel", "Online" }
    )
)

Percentage =
DIVIDE (
    [Sum certain channel],
    CALCULATE ( SUM ( '1819 transposed'[Volume] ), ALL ( '1819 transposed' ) )
)

1.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

5 REPLIES 5
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @david_MAS ,

 

Please provide sample data and desired output.

How to Get Your Question Answered Quickly

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi,

Okay, so sample data below - essentialy what I want is to get the sum of the first 3 channels below, but as a percentage of the entire value of the column "volume"

ChannelVolume
F2f10
Online2
Tel4
No shows6
Pending8
Referred online9
Reffered tel1
Self help0


Hope that makes sense and thank you for the reply.

Hi @david_MAS ,

 

Please refer to below measures:

Sum certain channel =
CALCULATE (
    SUM ( '1819 transposed'[Volume] ),
    FILTER (
        ALLSELECTED ( '1819 transposed' ),
        '1819 transposed'[Channel] IN { "F2f", "Tel", "Online" }
    )
)

Percentage =
DIVIDE (
    [Sum certain channel],
    CALCULATE ( SUM ( '1819 transposed'[Volume] ), ALL ( '1819 transposed' ) )
)

1.PNG

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Yuliana,

 

Thanks for this, that's looking realy good!

 

As an extension to this, say I wanted to show this percentage month-by-month (not cumulative) based on the UK-standard financial year, would this involve anothr filter within this measure or is it more striagtforward than that?

Thanks

Hi @david_MAS ,

 

With current sample data, I cannot see any relative date field to support Month-by-Month calculation. Since the original question has been worked out, would you please kindly mark the helpful reply as an answer? For further requirement, I would suggest you post a new thread on forum with more detailed sample data together with desired output to make the scenario more clear, so that more community members can view it and provide advice.

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

Top Solution Authors
Top Kudoed Authors