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

Dax measure by category

Hello there, 

I have a dataset that looks like this and I am trying to do the following:

DateIDSUM of COGS by IDSUM of Net Sales by ID
01-Jan-20202011050
01-Feb-20202011050
01-Mar-20202011050
01-Jan-20202022080
01-Feb-20202022080


I would like to create a DAX Measure that calculates blended GGP for each ID no by adopting the following formula: GGP = (Net Sales - COGS)/Net Sales
Basically: 
ID 201 = (50-10)/50 =0,8
ID202=(80-20)/80= 0,75

Any suggestions how I can do it? 

3 REPLIES 3
Fowmy
Super User
Super User

@krista_003 

Add the following measure:

GGP = 
DIVIDE(
    SUM(Financial[NET SALES]) - SUM(Financial[COGS] ),
    SUM(Financial[NET SALES])
)

Fowmy_0-1604231244688.png

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@Fowmy , Super, thanks! that's exactly what I needed!

By any chance do you know how I can calculate the blended Total GGP%  from the table?

IDGGPCOGSNet Sales
20180%1050
20275%2080
Total77,6%30130

 

Total Blended GGP =(130-30)/130=0,766

Usually Power BI calculates total GGP as an average, which is incorrect. How I can change it? 

 

@krista_003 

This is how the calculation is done at total level

GGP =(130-30)/130

If you have any other method please explain with expected results and examples.

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.