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
srasel
New Member

DAX formula to divide one row value with another particular row value

Hello All:

 

I need your help to figure out a DAX formula. I have a table in the left with columns - Project Name, Level 2 & Value. Now need to define a DAX measure to find the value of Gross Profit Margin. The rule is: for each group (Project Name), Gross Profit Margin = (Gross Profit value / Revenue value)

 

 

Query DAX.PNG

Thank you in advance.

 

Regards,

rasel

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

Hi @srasel,

Why not pivot the Level 2 column in Query Editor shown in the following screenshot and then create a new column using the following formula?

NewColumn = Table1[Gross Profit]/Table1[Revenue]

2.PNG

You can check the values of new column in the figure below, for more details, you can review the example in the attached PBIX file.
1.PNG

3.PNG

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yuezhe-msft
Employee
Employee

Hi @srasel,

Why not pivot the Level 2 column in Query Editor shown in the following screenshot and then create a new column using the following formula?

NewColumn = Table1[Gross Profit]/Table1[Revenue]

2.PNG

You can check the values of new column in the figure below, for more details, you can review the example in the attached PBIX file.
1.PNG

3.PNG

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-yuezhe-msft:

 

Thank you! Restructuring the data like that will work I guess. Let me try that on my input set. Hope that will work there too.

 

Thank you once again. Really appreciat that.

 

Regards,

rasel

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.