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

DAX formulas

Please help. I have a table that looks like this and woud like to calculate the following:

 

1. DAX formula to calculate $ for AA as % of total $ for each project.

2. DAX formula to calculate $ for AA as % of $ for BB for each project

3. DAX formula to calculate $ for AA as % of $s for AA+BB for each prpject

 

ProjectWBS Level 2WBS Level 3$
X/9999AAAA_001100
X/9999AAAA_00270
X/9999AAAA_00370
X/9999AAAA_00470
X/9999AAAA_00569
X/9999BBBB_00150
X/9999BBBB_00269
X/9999BBBB_00370
X/9999BBBB_00420
X/9999CCCC_0010
X/9999CCCC_0020
X/9999CCCC_0030
X/9999DDDD_001-50
X/10000AAAA_00190
X/10000AAAA_00290
X/10000AAAA_00390
X/10000BBBB_001100
X/10000BBBB_00230
X/10000BBBB_00380
X/10000BBBB_00490
X/10000BBBB_00570
X/10000CCCC_00180
X/10000DDDD_001100
X/10000EEEE_001300
1 ACCEPTED SOLUTION

Hey @bdaodu ,

 

this measure

Measure 1 = 
DIVIDE(
     SUM('Table'[$] )
     , CALCULATE(
         SUM( 'Table'[$] )
         , ALL( 'Table'[WBS Level 2] )
     )
)

returns what you are looking for, for the 1st formula:
image.png
Use the formatting option
image.png

 

Hopefully, this provides what you are looking for.

 

Regards,

Tom

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

5 REPLIES 5
bdaodu
New Member

For 1. DAX formula to calculate $ for AA as % of total $ for each project.;

 

the expected result would be a table like this: using the followibg formula:

 

sum of AAs for project x/ sum of project x total

 

ProjectWBS Level 2%
X/9999AA70%
X/9999BB39%
X/9999CC0%
X/9999DD-9%
X/10000AA24%
X/10000BB33%
X/10000CC7%
X/10000DD9%
X/10000EE27%

Hey @bdaodu ,

 

this measure

Measure 1 = 
DIVIDE(
     SUM('Table'[$] )
     , CALCULATE(
         SUM( 'Table'[$] )
         , ALL( 'Table'[WBS Level 2] )
     )
)

returns what you are looking for, for the 1st formula:
image.png
Use the formatting option
image.png

 

Hopefully, this provides what you are looking for.

 

Regards,

Tom

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Thank you!! It worked!

Hey @bdaodu ,

 

please mark an answer as solution, this will help others, looking for a similar solution.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
TomMartens
Super User
Super User

Hey @bdaodu ,

 

please provide the expected result and explain the calculation to get the result based on the sample data you provided-

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.