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
giramswa
Helper II
Helper II

Compare two rows of same column of one table and return only the difference

Hi All,

 

I have Monthly_Project_Summary_History table as shown below:

 

SNAPSHOT_WEEKSUMMARYauthorsummary_author_emailProject_ID
May 29, 2010Old SummaryAbc Xyzabc.xyz@company.comP_1
June 29, 2010Old SummaryAbc Xyzabc.xyz@company.comP_1
July 29, 2010New SummaryAbc Xyzabc.xyz@company.comP_1
August 29, 2010New SummaryAbc Xyzabc.xyz@company.comP_1
September 29, 2010Final SummaryNop Qrsnop.qrs@company.comP_1

 

Above is an example of records for a single project.
This table captures monthaly summary of every Open project. I need to create a report to show Summary on only those snapshot_week when the Summary was changed. So expected outcome is as below:

SNAPSHOT_WEEKSUMMARYauthorsummary_author_emailProject_ID
May 29, 2010Old SummaryAbc Xyzabc.xyz@company.comP_1
July 29, 2010New SummaryAbc Xyzabc.xyz@company.comP_1
September 29, 2010Final SummaryNop Qrsnop.qrs@company.comP_1

 

How to achieve this?

1 ACCEPTED SOLUTION

hi @giramswa 

if that is the case, try to create a calculated table like this:

SumTable =
ADDCOLUMNS(
    SUMMARIZE(
        TableName,
        TableName[Summary],
        TableName[author],
        TableName[summary_author_email],
        TableName[Project_ID]
    ),
    "SNAPSHOT_WEEK",
    CALCULATE(MAX(TableName[SNAPSHOT_WEEK]))
)
 
i tried and it worked like this:
FreemanZ_0-1673008193733.png

 

View solution in original post

7 REPLIES 7
Gokul_G16
Resolver I
Resolver I

Hey @giramswa ,


According to you request for this you can dynamically douvable from Power Query only.
Step 1; Concatenate =
Date  & Summary & Author ID.

Step 2; remove duplicates.
Just select the concatenate column and then click the Re-Duplicate.

Step 3;
Close and apply. 
finally you got it.


Thanks 
Gokul.

My table is Calculated table (created via DAX by joining other two tables and selecting only required columns), so I cannot go to Power Query editor for this. Thats why I am looking for a DAX to achieve final solution.

FreemanZ
Super User
Super User

hi @giramswa 

what do you mean by "change" in "show Summary on only those snapshot_week when the Summary was changed"?

Hi @FreemanZ 

If you look at SUMMARY column in my table, values are same for first two months and then they are same for third are fourth month. I want to shows rows with unique SUMMARY on my report.

 

hi @giramswa 

if that is the case, try to create a calculated table like this:

SumTable =
ADDCOLUMNS(
    SUMMARIZE(
        TableName,
        TableName[Summary],
        TableName[author],
        TableName[summary_author_email],
        TableName[Project_ID]
    ),
    "SNAPSHOT_WEEK",
    CALCULATE(MAX(TableName[SNAPSHOT_WEEK]))
)
 
i tried and it worked like this:
FreemanZ_0-1673008193733.png

 

Thank you so much, this was really helpful.

hi @giramswa 

you may also plot a table visual with zero code. like this:

FreemanZ_0-1673008458133.png

 

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.