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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

DAX help

why does this measure not work?

 

 

penetration = divide(CALCULATE(sum(Detail[Sales New Used]),Detail[Sales New Used]="New"),SUM('Dealer Summary'[Regs]))
 
sales new used needs to be divided by Regs but only the 'new' must be totaled and divided.
1 ACCEPTED SOLUTION

@Anonymous 

because denominatordenominator is 0.

you can use DIVIDE

Result = DIVIDE([count],[Regs2])
1.PNG




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

Proud to be a Super User!




View solution in original post

11 REPLIES 11
v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Might because of the denominator. Try:

penetration = divide(CALCULATE(sum(Detail[Sales New Used]),Detail[Sales New Used]="New"),Calculate(SUM('Dealer Summary'[Regs]),All('Dealer Summary'))

 If it doesn't work, please show some sample data and expected result.

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Anonymous
Not applicable

This is the part of my measure which  doesnt work

Part 1 = Calculate(SUM('Detail'[Sales New Used]),('Detail'[Sales New Used]="New")
what i need this to do is filter all the New deals and count them up for each business area to then be divided by the RE
Below is all the data required for this measure :

Business area

REGS

Sales new used

penetration

 

A

200

New

(Count of new) ‘New’/REGS

 

B

300

New

 

 

C

453

New

 

 

A

200

Used

 

 

B

234

Used

 

 

C

754

New

 

 

A

768

New

 

 



@Anonymous 

is this what you want?

Column = 
CALCULATE(COUNT('Table'[Sales new used]),FILTER('Table','Table'[Business Area]=EARLIER('Table'[Business Area])&&'Table'[Sales new used]="New"))

1.PNG





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

Proud to be a Super User!




Anonymous
Not applicable

this is what i want 

 

Business Area

REGS

Sales New used

Pen

 

 

 

A

968

2

2/968=0.002
x 100 = 0.2%

 

 

 

B

300

1

 

 

 

 

C

1207

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

@Anonymous 

pls see the attachment below





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

Proud to be a Super User!




Anonymous
Not applicable

Why am i getting infinity and values over 100%

@Anonymous 

I suggest you check regs and count. You mean the business area have the results for regs and count, but result is infinity?





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

Proud to be a Super User!




Anonymous
Not applicable

yes 

Maleehah_0-1630921260306.png

 

@Anonymous 

because denominatordenominator is 0.

you can use DIVIDE

Result = DIVIDE([count],[Regs2])
1.PNG




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

Proud to be a Super User!




Anonymous
Not applicable

@v-jayw-msft I have added a sample data table

ryan_mayu
Super User
Super User

@Anonymous 

maybe you can try to saparate the DAX to two parts and check which part didn't return the expected result.

CALCULATE(sum(Detail[Sales New Used]),Detail[Sales New Used]="New")

SUM('Dealer Summary'[Regs])





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

Proud to be a Super User!




Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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