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

The Fabric community is upgrading! Read all of the details including the timeline and what you can expect. Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

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.