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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
jiji
Frequent Visitor

Unchanged Status over multiple weeks

Hi guys, i have a table with 3 columns; Names, Status, date(8 weeks).
I want to return the names with unchanged status for the past weeks. Do you have any idea how to build it in dax? Really appreciate your help.

Data:

NAME          Week1       Week2      Week3       Week4        Week5        Week6
John             A                  B              C                C                C                  C
Ray               B                  B              B                 B                B                  B
Mary            A                  B               C                 D               E                  F

GOAL:
Name        STATUS       COUNT
John            C                 4
Ray              B                 6
1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @jiji ,

Pls refer the below:

1.unpovit:

vluwangmsft_0-1668503677846.png

2.use the below dax to create new column:

WEEK2 = RIGHT('Table 2'[Attribute],1)
COUNT = CALCULATE(COUNT('Table 2'[Value]),FILTER(ALL('Table 2'),'Table 2'[Name]=EARLIER('Table 2'[Name])&&'Table 2'[Value]=EARLIER('Table 2'[Value])))
COUNT2 = 'Table 2'[COUNT]+0.1*'Table 2'[WEEK2]
TEST = MAXX(FILTER('Table 2','Table 2'[Name]=EARLIER('Table 2'[Name])),'Table 2'[COUNT]+0.1*'Table 2'[WEEK2])

vluwangmsft_1-1668503790099.png

 

 

3.create new table:

Table 3 = SELECTCOLUMNS(FILTER('Table 2','Table 2'[COUNT2]='Table 2'[TEST]),"Name", 'Table 2'[Name],"Status",'Table 2'[Value],"count",'Table 2'[COUNT])

Output result:

vluwangmsft_2-1668503840723.png

 

 

Best Regards

Lucien

View solution in original post

3 REPLIES 3
v-luwang-msft
Community Support
Community Support

Hi @jiji ,

Pls refer the below:

1.unpovit:

vluwangmsft_0-1668503677846.png

2.use the below dax to create new column:

WEEK2 = RIGHT('Table 2'[Attribute],1)
COUNT = CALCULATE(COUNT('Table 2'[Value]),FILTER(ALL('Table 2'),'Table 2'[Name]=EARLIER('Table 2'[Name])&&'Table 2'[Value]=EARLIER('Table 2'[Value])))
COUNT2 = 'Table 2'[COUNT]+0.1*'Table 2'[WEEK2]
TEST = MAXX(FILTER('Table 2','Table 2'[Name]=EARLIER('Table 2'[Name])),'Table 2'[COUNT]+0.1*'Table 2'[WEEK2])

vluwangmsft_1-1668503790099.png

 

 

3.create new table:

Table 3 = SELECTCOLUMNS(FILTER('Table 2','Table 2'[COUNT2]='Table 2'[TEST]),"Name", 'Table 2'[Name],"Status",'Table 2'[Value],"count",'Table 2'[COUNT])

Output result:

vluwangmsft_2-1668503840723.png

 

 

Best Regards

Lucien

Ashish_Mathur
Super User
Super User

Hi,

For the row of Mary, if there were 3 C's and 3 F's, then what result would you expect?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello Ashish, Thank you for your message. In that scenario, I would only be interested on the latest dates unchanged status. Say:
NAME   W1   W2   W3    W4   W5   W6
MAR     C       C      A      A       F      F

GOAL IS 
NAME      STATUS       COUNT
MARY         F                  2

I hope this makes sense. My data in the back end is the typical: Name, Date, Status Columns.
Then in the dashboard I just created a matrix table so that I could place Date as columns then count the number of status.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.