cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
AshleyRenee
Frequent Visitor

Percent of multiple text values in a column

Hello, 

 

Is there a way to use this formula but of multiple text values? 

= (Calculate(counta('Table'[Response]), 'Table'[Response] = "Yes")) / (Countrows ('TableName')

 

So instead of yes, I want to find the percent of the following text values: 

AA - Other

AA - iLead

AB 

 

Your help is appreciated.

1 ACCEPTED SOLUTION

Hi @AshleyRenee ,

 

You had the ( on the incorrect place try the following formula:

%referralstoAnyWhere =
DIVIDE (
    (
        CALCULATE (
            COUNTA ( 'ReferralsToAnywhere'[realogy_group] ),
            'ReferralsToAnywhere'[realogy_group] IN { "AA - iLead", "AA - Other", "AB" }
        )
    ),
    COUNTROWS ( 'ReferralsToAnywhere'[ReferralsToAnywhere] )
)

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
MFelix
Super User
Super User

Hi @AshleyRenee 

 

If you have that column on the visualization then you can do the following:

= DIVIDE((Calculate(counta('Table'[Response]), 'Table'[Response] in  VALUES('Table'[Response]))) , (Countrows ('TableName'))

 

If you want to hard coded you can do:

=DIVIDE( (Calculate(counta('Table'[Response]), 'Table'[Response] in {"AA - Other", "AA - iLead", "AB"}) , (Countrows ('TableName'))

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hello! 

 

Thank you! I tried doing the foruma for the hard code. 

%referralstoAnyWhere = DIVIDE((CALCULATE(COUNTA('ReferralsToAnywhere'[realogy_group]), 'ReferralsToAnywhere'[realogy_group] in {"AA - iLead", "AA - Other", "AB"}), (COUNTROWS('ReferralsToAnywhere'ReferralsToAnywhere))
 
But am getting this error. 
Operator or expression '( )' is not supported in this context.

Hi @AshleyRenee ,

 

You had the ( on the incorrect place try the following formula:

%referralstoAnyWhere =
DIVIDE (
    (
        CALCULATE (
            COUNTA ( 'ReferralsToAnywhere'[realogy_group] ),
            'ReferralsToAnywhere'[realogy_group] IN { "AA - iLead", "AA - Other", "AB" }
        )
    ),
    COUNTROWS ( 'ReferralsToAnywhere'[ReferralsToAnywhere] )
)

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors