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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
cmckinney
Helper IV
Helper IV

Change first column in matrix to show different text value using DAX.

Basically, I have a DAX expression that is in the values field of a matrix that shows whether or not a hashed values has changed from the previously displayed date to the newer date. That explaination may be confusing so I will attach a screenshot of what I mean. What it is currently showing in the first column of the matrix is "rule has changed" BUT I need the first column to say is "no change". Can anyone help me edit this DAX expression so that the first column in the matrix is showing "no change"?

 

Formula 1.png

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@cmckinney - I think I fixed this in our other thread, sorry it took me a bit to get to it, check there and let me know. The suggestion from the other thread was:

Measure =
  VAR __Rule = MAX([Rule])
  VAR __CurrentDate = MAX([Analysis Run])
  VAR __CurrentHash = MAX([Hash])
  VAR __PreviousDate = MAXX(FILTER(ALL('Table'),[Analysis Run]<__CurrentDate),[Analysis Run])
  VAR __PreviousHash = MAXX(FILTER(ALL('Table'),[Analysis Run]=__PreviousDate && [Rule]=__Rule),[Hash])
RETURN
  SWITCH(TRUE(),
    ISBLANK(__PreviousDate)||__PreviousDate<0||YEAR(__PreviousDate)<1900,0,
    ISBLANK(__Rule),0,
    __Rule = "UnusedRule1",0,
    __PreviousHash <> __CurrentHash,1,BLANK(),
    2
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

1 REPLY 1
Greg_Deckler
Community Champion
Community Champion

@cmckinney - I think I fixed this in our other thread, sorry it took me a bit to get to it, check there and let me know. The suggestion from the other thread was:

Measure =
  VAR __Rule = MAX([Rule])
  VAR __CurrentDate = MAX([Analysis Run])
  VAR __CurrentHash = MAX([Hash])
  VAR __PreviousDate = MAXX(FILTER(ALL('Table'),[Analysis Run]<__CurrentDate),[Analysis Run])
  VAR __PreviousHash = MAXX(FILTER(ALL('Table'),[Analysis Run]=__PreviousDate && [Rule]=__Rule),[Hash])
RETURN
  SWITCH(TRUE(),
    ISBLANK(__PreviousDate)||__PreviousDate<0||YEAR(__PreviousDate)<1900,0,
    ISBLANK(__Rule),0,
    __Rule = "UnusedRule1",0,
    __PreviousHash <> __CurrentHash,1,BLANK(),
    2
  )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors