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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

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
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Kudoed Authors