Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Get total cost per month and place it on a table

Hi everyone,

 

I have this table:

Cost per month.jpg

 

I just need to get the total cost per month (from a column from another table) and place it on the "Total Cost/Month" column.

 

Here's the source table

2019-01-21_12-56-121.jpg

 

and this should be the result

2019-01-21_12-56-12.jpg

 

I'm just new to Power BI I just can't figure it out how to do it

 

TIA!

1 ACCEPTED SOLUTION
v-danhe-msft
Employee
Employee

Hi @Anonymous,

Based on my test, you could refer to below formula:

Column = IF(CALCULATE(SUM(Table1[Cost]),FILTER('Table1','Table1'[Month]=Table2[Month Number]))<>BLANK(),CALCULATE(SUM(Table1[Cost]),FILTER('Table1','Table1'[Month]=Table2[Month Number])),0)

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

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

4 REPLIES 4
v-danhe-msft
Employee
Employee

Hi @Anonymous,

Based on my test, you could refer to below formula:

Column = IF(CALCULATE(SUM(Table1[Cost]),FILTER('Table1','Table1'[Month]=Table2[Month Number]))<>BLANK(),CALCULATE(SUM(Table1[Cost]),FILTER('Table1','Table1'[Month]=Table2[Month Number])),0)

Result:

1.PNG

You could also download the pbix file to have a view.

 

Regards,

Daniel He

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

Hey @v-danhe-msft thanks for this! I am studying the formula so I can use it on my other files. You know where I can hae a basic tutorial or guide on the formulas? Thanks

CheenuSing
Community Champion
Community Champion

Hi @Anonymous

 

Please put some sample data of the tables you have in your data model and the actual result you expect.

 

 

Cheers

 

CheenuSing

Did I answer your question? Mark my post as a solution and also give KUDOS !

Proud to be a Datanaut!
Anonymous
Not applicable

Hi @CheenuSing I updated my question already. thanks!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.