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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Get percentage using filter

Hi, 

I am trying to calculate % using the filter function

 

it is just count(Opened)/sentable[sentCount]

 

ajantika25_0-1618522706888.png

 

 

I have already calculated an OpenTotal measure, but I cannot this is on the % calculation, it is not showing up.

 

 

OpenTotal = CALCULATE(
count(ActivityTable[leadId] ),
FILTER( ActivityTable, ActivityTable[activity] = "opened") )

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi @Anonymous 

 

Maybe you put the closing bracket incorrectly,and you could modify your measure by the following formula:

OpenTotalRate1 =
DIVIDE (
    CALCULATE (
        COUNT ( 'ActivityTable'[Product] ),
        FILTER ( ALL ( 'ActivityTable' ), 'ActivityTable'[activity] = "opened" )
    ),
    'sentable'[sentCount]
)

Or

OpenTotalRate2 =
COUNTX (
    FILTER ( ALL ( 'ActivityTable' ), 'ActivityTable'[activity] = "opened" ),
    'ActivityTable'[leadId]
) / 'sentable'[sentCount]

In addition, If sentable[sentCount] is a column (only one counted number),you could change 'sentable'[sentCount] to VALUES('sentable'[sentCount])

The final output is shown below:

percentage.jpg

Best Regards,

Yalan Wu

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

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi @Anonymous 

 

Maybe you put the closing bracket incorrectly,and you could modify your measure by the following formula:

OpenTotalRate1 =
DIVIDE (
    CALCULATE (
        COUNT ( 'ActivityTable'[Product] ),
        FILTER ( ALL ( 'ActivityTable' ), 'ActivityTable'[activity] = "opened" )
    ),
    'sentable'[sentCount]
)

Or

OpenTotalRate2 =
COUNTX (
    FILTER ( ALL ( 'ActivityTable' ), 'ActivityTable'[activity] = "opened" ),
    'ActivityTable'[leadId]
) / 'sentable'[sentCount]

In addition, If sentable[sentCount] is a column (only one counted number),you could change 'sentable'[sentCount] to VALUES('sentable'[sentCount])

The final output is shown below:

percentage.jpg

Best Regards,

Yalan Wu

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

Ashish_Mathur
Super User
Super User

Hi,

This measure can be simplified to

OpenTotal = CALCULATE(count(ActivityTable[leadId]),ActivityTable[activity] = "opened")

Not sure of what the SentTable is


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.