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
GKs
Frequent Visitor

Calculate and Divide Together

I am really a beginner with this tool, I am trying to make this calculation with DAX, however it does not show how I would like it.

 

 

Capture.PNG 

I know something is wrong, I can not find that 

 

Capture2.PNG

1 ACCEPTED SOLUTION
affan
Solution Sage
Solution Sage

Hi @GKs,

 

As you have mentioned that you are a beginner I have attached a power bi pbix file which you can download from link below.

 

https://www.dropbox.com/s/zpfk3yfpdevwbul/SalesPercent.pbix?dl=0

 

in this file I have tested the following result.

 

SalesPercent.png

 

 

If this helped you, please mark this post as an accepted solution and like to give KUDOS .

 

Regards,

Affan

View solution in original post

6 REPLIES 6
affan
Solution Sage
Solution Sage

Hi @GKs,

 

As you have mentioned that you are a beginner I have attached a power bi pbix file which you can download from link below.

 

https://www.dropbox.com/s/zpfk3yfpdevwbul/SalesPercent.pbix?dl=0

 

in this file I have tested the following result.

 

SalesPercent.png

 

 

If this helped you, please mark this post as an accepted solution and like to give KUDOS .

 

Regards,

Affan

GKs
Frequent Visitor

replicate the same formula and only divide the red / red, the other values are infinity

@GK

 

Have you tried downloading and checking the sample file I have shared?

GKs
Frequent Visitor

if I did, however it remains the same with infinity

 

Capture4.PNG

Hi @GK's

Can you share the measure you are using to calculate the division?

Based on what you are showing it appears to me that you are not placing the ALL statment to get the red even whe you have other groups. You get infinity because you are diving the quantity by null.

Regards,
MFelix

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



MFelix
Super User
Super User

Hi @GKs,

 

Add the following measure to your data model:

 

% = 
var Red_sales = CALCULATE(SUM(Sales[Sales]);Sales[Group] = "Red")
Return
 SUM(Sales[Sales]) / Red_sales

Should give you the expected result

 

Regards,

MFelix


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
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.