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
BMac-Coop
Frequent Visitor

Using percentage of a whole to calculate a bill

I'm not quite sure how to do this, but I'd think I could do this with a Measure.

 

I have a fixed cost of $100,000.  I have many projects...each uses a different percentage of the total capacity every month (as measured by story points).  I have a simple table visualization that sumarizes this:

 

Month 1:

ProjectNumber of pointsPercent of total
A1010%
B2020%
C3030%
D4040%

 

That visualization is made up of a dataset containing Agile Stories:

ProjectStory IDStory Points
A1233
A1244
A1252
A1261

 

The table visualiztion is very simple.  Don't summarize Project, Sum Story Points, and Sum Story Points shown as percentage of grand total.

 

In the table visualization (that shows a total of points by project and the percent of total points it made up), I'd like to add a column that takes the percentage consumed and calculates a consumption cost based on my fixed cost.  ie, 40% of the $100,000 fixed cost is $40,000.

 

In psudo code, effectively:

 

(sum of rows for project / sum of all rows) * 100000

 

But I can't wrap my head around how to write the DAX filter to take in the "Project A Sum of Rows" thing.  This seems simple, but I can't figure it out.  Any help would be greatly appriciated!

 

Thanks!

 

EDIT:

Let me include a few more details on something I've tried and some details of my challenge.

 

  • The dataset contains many months of data.  On the visualization I have it limited to a specific date range.
  • I've tried using ALL, but this removes the date filter as well as the filter for the context of the row.  Where I need to keep the DATE filter but loose the context filter of the particular visualization row.  This DAX is giving me the portion of this months points for this project compared to all months of all projects.  I need this month's portion of points for the project against this months point total:
    • Point Portion = DIVIDE(SUMX('Arrow & Yukon - Stories (Current)','Arrow & Yukon - Stories (Current)'[Story Points default to 1]) , SUMX(ALL('Arrow & Yukon - Stories (Current)'),'Arrow & Yukon - Stories (Current)'[Story Points default to 1]))
1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @BMac-Coop ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a measure as below:

yingyinr_0-1652756187213.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
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

3 REPLIES 3
v-yiruan-msft
Community Support
Community Support

Hi @BMac-Coop ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want. You can create a measure as below:

yingyinr_0-1652756187213.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

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

I ended up doing it a bit differently, but I think the same result:

 

Cost Per Project = 
DIVIDE(
	SUMX('Table','Table'[Story Points default to 1]),
	CALCULATE(
		SUM('Table'[Story Points default to 1]),ALL('Table'[CT Number])
		)
	) * 100000

 

Thanks for the ideas that got me going!

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. Avoid posting screenshots of your source data if possible.

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

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.

Top Solution Authors