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

how to calculate year wise product cost data by monthly headcount data every month and get YTD

I have two tables one is headcount its is in month wise every month there will be new data with historical data (data of all months in a year)and i have product cost table data which is year wise (just one sinlge date as 01/03/2022)for that year i have just single values. now i have to calculate the Product cost by headcount everymonth and to get YTD of that new Pex cost 

 

headcountvaluesproduct costvaluedatePex CostDateYTD Pex cost
01/01/20221001/12/2022500001/01/202250001/01/2022500
01/02/202220  01/02/202225001/02/2022750
01/03/202230formulaE2/B301/03/2022166.666666701/03/2022916.6666667
01/04/202240PEX costYearly Product cost/monthly Headcount01/04/202212501/04/20221041.666667
01/05/202250  01/05/202210001/05/20221141.666667
01/06/202260  01/06/202283.3333333301/06/20221225
01/07/202270  01/07/202271.4285714301/07/20221296.428571
01/08/202280  01/08/202262.501/08/20221358.928571
01/09/202290  01/09/202255.5555555601/09/20221414.484127
01/10/2022100  01/10/20225001/10/20221464.484127
01/11/2022110  01/11/202245.4545454501/11/20221509.938672
01/12/2022120  01/12/202241.6666666701/12/20221551.605339
01/01/2023130  01/01/202338.4615384601/01/20231590.066878
01/02/2023140  01/02/202335.7142857101/02/20231625.781163
01/03/2023150  01/03/202333.3333333301/03/20231659.114497
         
Image 11-09-23 at 5.12 PM.jpeg         
          
          
          
          
          
          
          
          
1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @powanpilla 

 

You can try the following methods.

Measure:

Pex Cost = 
Var _value=5000
Return
DIVIDE(_value,SUM('Table'[values]))
YTD Pex cost = SUMX(FILTER(ALL('Table'),[Date]<=SELECTEDVALUE('Table'[Date])),[Pex Cost])

vzhangti_0-1694567825156.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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-zhangti
Community Support
Community Support

Hi, @powanpilla 

 

You can try the following methods.

Measure:

Pex Cost = 
Var _value=5000
Return
DIVIDE(_value,SUM('Table'[values]))
YTD Pex cost = SUMX(FILTER(ALL('Table'),[Date]<=SELECTEDVALUE('Table'[Date])),[Pex Cost])

vzhangti_0-1694567825156.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

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

powanpilla
Frequent Visitor

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.