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
troystyle
Regular Visitor

Help with DAX calculation( addition and division)

I am relatively new to PowerBI and though i have created many dashboards and reports, i need help in creatiing this dax calculations in a report i am working on, i have tried several calculations and was getting the wrong results

 

I have two columns of data which looks as follows: 

 ParticipantsAB
 100
 425
 3120
 344
 600
 700
 1220
 341
 401
 921
 110
 133
 011
Total543116

 

The goal is to create a calculation ( measures or column)  with the following intent:

1. Add the totals of columns A &B , divide the sum of columns A&B by the total of column Participants and then convert the result into a percentage i.e  (31+16)/54 with results converted to percentage.

Any help will be appreciated with regards to the dax calcuation

Thanks
 

 

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

5 REPLIES 5
Sean
Community Champion
Community Champion

@troystyle Here you go...

Participants.png

Rommel
Frequent Visitor

Muchas gracias , me sirvio tambien a mi.

Sean

Immense thanks

I am focused on training myself on dax calculations, seeing that you are quite versed.

What are the best resources out there to get a new beginner like myself up to speed.

Thanks

Sean
Community Champion
Community Champion

http://www.sqlbi.com/ AND http://www.powerpivotpro.com/

 

Both are great AND both have published great books! 

 

I had been searching for a similar solution for about a week now.  and had found that division was only returning the numerator in anything i was trying.

 

=DIVIDE(numerator, denominator, optional case)    this lead me to believe that optional case was in fact optional and that it wasnt necessary.  But to do a proper calculation without the divide by zero case.. it needs that ,0 option.

 

with scalars not of the data set i tried =DIVIDE(25,33)  hoping that it would yield .75  and i was getting it to yield the numerator in return.  I had tried with sums of the columns i was using etc.  but i believe the appropriate thing here is that ,0 optional... if you do not need anything else in your operands that you should include the ,0 in the division formula....      as such   = [numerator] / [denominator]   will not yield the same result  as =DIVIDE([numerator], [denominator],0)    

 

so many SUM and SUMX and COUNTX and CALCULATE custom formulas wasted - it was a learning process though.

 

Thanks again for posing the question and providing the answer... now on to more difficult tasks.

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.