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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
slan2018
Frequent Visitor

Help to calculate close rate with a measure

Hello! I'm sure I'm just missing something simple here, because I haven't used measures in over a year (so I'm rusty!)

 

I'm just trying to create a measure that shows the rate of closed sales/total sales. 

 

For Closed Sales I created a counta measure 

PCloseRateM = COUNTA('Proposals Paste'[ID])
For Total Sales I created a counta measure 
PSaleRateM = COUNTA('Stats, Sales, Loss, Etc'[Actual Sales Monthly])
 
To calculate my rate I tried a measure that says 
CloseM = [PSaleRateM]/[PCloseRateM], and formatted it as a %
 
I am getting results, but they're wrong. It should calculate 7/59 = 11.86%; instead it's showing 3.39%. I do have a date filter. 
 
Does anyone have any thoughts? 
 
 

image.png

3 REPLIES 3
Anonymous
Not applicable

Nobody will be able to tell you what's wrong until you describe to us what the calculation should mean and how your data is structured. But you can try to diagnose this problem yourself. All you have to do is display the components from which your % is calculated. So, display this PCloseRateM = COUNTA('Proposals Paste'[ID]) and display this PSaleRateM = COUNTA('Stats, Sales, Loss, Etc'[Actual Sales Monthly]). You'll then see both the components and it'll be easier, I guess, to see why your division is the way it is. By the way, I can't see a reason you'd use COUNTA. Isn't it better to use COUNTROWS?

harshnathani
Community Champion
Community Champion

Hi @slan2018 ,

 

 

Yu can try this

 

CloseM =
VAR PCloseRateM =
    COUNTROWS ( 'Proposals Paste' )
VAR PSaleRateM =
    COUNTROWS ( 'Stats, Sales, Loss, Etc' )
RETURN
    DIVIDE (
        PCloseRateM,
        PSaleRateM
    )

 

Else pls share some sample data and expected output.

 

Regards,

Harsh Nathani

 

Greg_Deckler
Super User
Super User

@slan2018 - Wondering if perhaps you need an ALL clause in your measure, but hard to tell. Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
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