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
jgodden
Regular Visitor

Data refresh impact on existing data

Hi,

 

I have a table tracking the status of new accounts including a field for their status. Each week the table is updated and if a status changes, then a new line is added to the sheet with a new status. I need to show a visual for the accounts where the status has changed. What would be the best method for this?

1 ACCEPTED SOLUTION
KGrice
Memorable Member
Memorable Member

This will partially depend on what you have in your data to indicate the status changes over time. Is there a date for each status?

 

Here's one way to do it using some made up data below. Before using Close and Apply to load the data, I sorted the data first by Account and then by StatusDate, and then added an Index column. This will allow you to see an ordered, row-by-row view of the changes as they occur to each account.

 

Then I added a new column in the Data view with the following formula:

 

StatusChanged = IF(
AND(TableName[Status]<>LOOKUPVALUE(TableName[Status], TableName[Index], TableName[Index]-1, TableName[Account], TableName[Account])
,NOT(ISBLANK(LOOKUPVALUE(TableName[Status], TableName[Index], TableName[Index]-1, TableName[Account], TableName[Account])))
), 1, 0)

 

That will check the previous status against the current status, and make sure the previous status wasn't blank, i.e., there was no previous status because it's the first entry for that account.

 

StatusChange.PNG

 

You can then use that StatusChanged column as a filter in your visuals. Use TRUE/FALSE if you prefer that over the 1/0 values. You could also right-click the Index column and choose Hide in Report View since it won't mean anything to anybody. 

View solution in original post

1 REPLY 1
KGrice
Memorable Member
Memorable Member

This will partially depend on what you have in your data to indicate the status changes over time. Is there a date for each status?

 

Here's one way to do it using some made up data below. Before using Close and Apply to load the data, I sorted the data first by Account and then by StatusDate, and then added an Index column. This will allow you to see an ordered, row-by-row view of the changes as they occur to each account.

 

Then I added a new column in the Data view with the following formula:

 

StatusChanged = IF(
AND(TableName[Status]<>LOOKUPVALUE(TableName[Status], TableName[Index], TableName[Index]-1, TableName[Account], TableName[Account])
,NOT(ISBLANK(LOOKUPVALUE(TableName[Status], TableName[Index], TableName[Index]-1, TableName[Account], TableName[Account])))
), 1, 0)

 

That will check the previous status against the current status, and make sure the previous status wasn't blank, i.e., there was no previous status because it's the first entry for that account.

 

StatusChange.PNG

 

You can then use that StatusChanged column as a filter in your visuals. Use TRUE/FALSE if you prefer that over the 1/0 values. You could also right-click the Index column and choose Hide in Report View since it won't mean anything to anybody. 

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.