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
kajelliott
Helper I
Helper I

DAX Measure to show the total percentage of opportunities won for the associated lead source?

Hi All, 

 

I have a column of lead sources in my data table and have calculated the percentage of opportunties won with a DAX calculation which results in this table.

Lead SourceTotal % Won
A22%
B24%
C70%
D13%
E17%


How do I create a Dax expression so that this percentage will display in a table against the opportunity like so?

OpportunityLead SourceLead Source Won
Name AE17%
Name BD13%
Name CA22%
Name DB24%

 

Opportunity and Lead Source exist in the same data table in power BI
The Total % Won calculation is DIVIDE([Total Opps for Won], [Total Opps]) + 0


Any help is appreciated! Thank you 🙂

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @kajelliott ,

 

You can try below formula:

M_ =
VAR total_ =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER ( ALL ( 'Table' ), 'Table'[Load Source] = MAX ( 'Table'[Load Source] ) )
    )
VAR cur_ =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Load Source] = MAX ( 'Table'[Load Source] )
                && 'Table'[Status] = "won"
        )
    )
RETURN
    IF ( ISBLANK ( DIVIDE ( cur_, total_ ) ), 0, DIVIDE ( cur_, total_ ) )

vkongfanfmsft_0-1709112095755.png

Best Regards,
Adamk Kong

 

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

6 REPLIES 6
Anonymous
Not applicable

Hi @kajelliott ,

 

Based on your description, you could create a data table similar to the following and then apply this formula.

vkongfanfmsft_0-1708998471430.png

PercentageWon = 
VAR totalOpps =
    CALCULATE ( SUM ( 'Table'[Total Opps] ) )
VAR wonOpps =
    CALCULATE ( SUM ( 'Table'[Total Opps for won] ) )
RETURN
    DIVIDE ( wonOpps, totalOpps ) + 0

 

vkongfanfmsft_1-1708998535036.png

Best Regards,
Adamk Kong

 

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

Hi @Anonymous 

 

Thanks for your suggestion. Both [Total Opps} & [Total Opps for Won] are measures, so it will not allow that for the expression you have written. 

 

Also, I notice that the expression does not reference the Lead Source at all, so i'm not sure how this would work. It looks like the expression would return the percentage won for each opportunity, which will either be 100% or 0% depending on the opportunity. 

 

Let me know what you think.

 

Thanks!

Kayla

Anonymous
Not applicable

Hi @kajelliott ,

 

I don't quite understand what you need, please provide some test data and screenshot information and explain it.

 

Best Regards,
Adamk Kong

 

Hi @Anonymous 

Sorry, it wont let me upload a pbix file which is frustrating. To give you an idea, my data looks like this: 

kajelliott_3-1709073244795.png

 

I then create measures to return the percentage of opportunies won which results in this 

kajelliott_4-1709073319250.png

What I need is a measure that returns the percentage of opportunities won for the lead source of each opportunity. Eg, Opportunities with a lead source 'Website' are won 80% of the time.

Example below - 

kajelliott_2-1709072884455.png

Hopefully this helps!

 

Thank you. 

Anonymous
Not applicable

Hi @kajelliott ,

 

You can try below formula:

M_ =
VAR total_ =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER ( ALL ( 'Table' ), 'Table'[Load Source] = MAX ( 'Table'[Load Source] ) )
    )
VAR cur_ =
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Load Source] = MAX ( 'Table'[Load Source] )
                && 'Table'[Status] = "won"
        )
    )
RETURN
    IF ( ISBLANK ( DIVIDE ( cur_, total_ ) ), 0, DIVIDE ( cur_, total_ ) )

vkongfanfmsft_0-1709112095755.png

Best Regards,
Adamk Kong

 

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

Hi @Anonymous 

 

This is perfect! Thank you so much for your time and effort. It is greatly appreciated 🙂

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.