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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.