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

Help with creating a FORMULA for counting rows of a table.

I've created the table below, which details all of our important Master Opportunities in Salesforce (11 total). Based on this information I want to provide the user with a % of those Opportunities that we've deemed "Power of One" (meaning involves agencies across our network). That total is 10.

 

Thus, the formula should should exhibiting 90.9% [10/11]. However, I'm not able to configure how to COUNT only the rows of the current visualized table- which again, is 11 (as opposed to the entire # of rows in the ENTIRE TABLE, which is 10K+). As you can see it's returning 100%.

 

Here's the current formula: 

% Po1 = count(Opportunity[Po1 (to use)]) / CALCULATE(countrows(Opportunity),ALLSELECTED(Opportunity[Name]))
 
I'm hoping to find how to count only the rows in the table I'm measuring against, NOT the entire table.

% of Po1 HELP.png

 

Any help is appreciated.

6 REPLIES 6
Tschwenn
Helper I
Helper I

I believe the formula should be something like this:

% Po1 = count(Opportunity[Po1 (to use)]) / count(Opportunity[Include_in_Commercial_Pulse__c]
 
But I receive the following error message: 
 
error message.png
AlB
Super User
Super User

@Tschwenn 

Ok, but what is the restriction for "Po1 (to use)" to get the 10 values?? cause if you just do

COUNT(Opportunity[Po1 (to use)])

it seems like you should get the 11, right? i.e. the 11 rows that are active in the filter context stemming from the two filters you described

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

 

Tschwenn
Helper I
Helper I

Hi @AlB ,

Thank you for the quick reply.

 

The 11 are from 2  denoting:

  • "Include_in_Commercial_Pulse__c" = TRUE
  • "StageName" = OPEN

filters.png

The 10 come from a New Column I created from the following formula:

Po1 (to use) = IF(
    ISERROR(
        SEARCH("YES", Opportunity[Po1 ROLLUP])
    ),
    " ",
    "*"
)

 

Basically, the table is used to illustrate our Top Opportunities, and the Po1 column denotes which ones involved multiple agencies. I want to then show the % of the Top Opps that are Po1.

 

AlB
Super User
Super User

Hi @Tschwenn 

I see 11 rows in the table visual you are showing. Why is that? Where is the 10 coming from? And the 11 (i.e., the currently visualized table)? What filters are active on the table that will determine those 10 rows for the denominator in your formula  and, alos, what filters will determine the 11?

 

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

 

SU18_powerbi_badge

@AlB:

  • The 11 come from the filter: Include_in_Commercial_Pulse__c = TRUE
    • Our Salesforce instance has 10K+ opportunities. But only a handful are deemed worthy of this bi-weekly report. Thus, we have a checkbox on each Opportunity, denoting "Include in Commercial Pulse." If the box is checked, then it's automatically synced to PowerBI.
  • The 10 come from the following formula: 
Po1 (to use) = IF(
    ISERROR(
        SEARCH("YES", Opportunity[Po1 ROLLUP])
    ),
    " ",
    "*"
)

@AlB any thoughts to what I provided?

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.

Top Solution Authors