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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
caio_queiroz
Frequent Visitor

Identify all items (rows) that does not exists in previous month.

Hello All.

 

I have a table Resource Cost, with my resource costs in Septmeber and October, i want to compare the costs between the two month, but i also want to take off what is new (it means resources created in October) to use it for the compare.

 

I have tried several ways, but none i got what i need.

 

Could you guys help me?

btw i have a calendar table in my dashboard and there is a relationship with my resources tables

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Since there is no sample data model, I created it by myself.

I am not sure if it fits your situation.

Check the below picture and the attached pbix file below.

All measures are in the attached pbix file.

 

Picture1.png

 

October new resouces: =
VAR septemberresouces =
CALCULATETABLE ( VALUES ( Data[Resource] ), 'Calendar'[Month] = 9 )
VAR octoberresources =
CALCULATETABLE ( VALUES ( Data[Resource] ), 'Calendar'[Month] = 10 )
VAR octobernewresources =
EXCEPT ( octoberresources, septemberresouces )
RETURN
IF ( COUNTROWS ( octobernewresources ) = 1, "New in October" )
 
Sep & Oct resouces cost difference: =
VAR septemberresouces =
CALCULATETABLE ( Data, 'Calendar'[Month] = 9 )
VAR octoberresources =
CALCULATETABLE ( Data, 'Calendar'[Month] = 10 )
VAR sep_oct_both_resources =
INTERSECT (
SUMMARIZE ( octoberresources, Data[Resource] ),
SUMMARIZE ( septemberresouces, Data[Resource] )
)
VAR cost_diff_addcolumns =
ADDCOLUMNS (
sep_oct_both_resources,
"@costdiff",
CALCULATE (
SUMX ( octoberresources, Data[Cost] ) - SUMX ( septemberresouces, Data[Cost] )
)
)
RETURN
SUMX ( cost_diff_addcolumns, [@costdiff] )
 
 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

View solution in original post

2 REPLIES 2
v-robertq-msft
Community Support
Community Support

Hi, 

Has Jihwan_Kim’s reply helped you to find the solution to this problem?

If so, would you like to mark his reply as a solution so that others can learn from it too?

Thanks in advance!

How to Get Your Question Answered Quickly 

 

Best Regards,

Community Support Team _Robert Qin

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

Jihwan_Kim
Super User
Super User

Hi,

Since there is no sample data model, I created it by myself.

I am not sure if it fits your situation.

Check the below picture and the attached pbix file below.

All measures are in the attached pbix file.

 

Picture1.png

 

October new resouces: =
VAR septemberresouces =
CALCULATETABLE ( VALUES ( Data[Resource] ), 'Calendar'[Month] = 9 )
VAR octoberresources =
CALCULATETABLE ( VALUES ( Data[Resource] ), 'Calendar'[Month] = 10 )
VAR octobernewresources =
EXCEPT ( octoberresources, septemberresouces )
RETURN
IF ( COUNTROWS ( octobernewresources ) = 1, "New in October" )
 
Sep & Oct resouces cost difference: =
VAR septemberresouces =
CALCULATETABLE ( Data, 'Calendar'[Month] = 9 )
VAR octoberresources =
CALCULATETABLE ( Data, 'Calendar'[Month] = 10 )
VAR sep_oct_both_resources =
INTERSECT (
SUMMARIZE ( octoberresources, Data[Resource] ),
SUMMARIZE ( septemberresouces, Data[Resource] )
)
VAR cost_diff_addcolumns =
ADDCOLUMNS (
sep_oct_both_resources,
"@costdiff",
CALCULATE (
SUMX ( octoberresources, Data[Cost] ) - SUMX ( septemberresouces, Data[Cost] )
)
)
RETURN
SUMX ( cost_diff_addcolumns, [@costdiff] )
 
 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.