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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
dedmondson
Advocate I
Advocate I

Flag status change and show list

I have a table with various fields however for this purpose  consider the following fields only:

item # (text field)

Payment date (date field)

Status (text field)

A slicer exists to select on payment date (which are month ends)

 

 

I want to be be able to identify a list of Item# whose status changed relative to the prior period only as shown. So if I select for 8/31/2018 in the slicer I will only see those Items whose status code changed from their status as of 07/31/2018

 

how would I create a measure to determin/reflect this?

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @dedmondson,

 

Create a measure, add it to visual level filter and set its value to 1.

check status =
IF (
    SELECTEDVALUE ( Table3[Status] )
        = CALCULATE (
            LASTNONBLANK ( Table3[Status], 1 ),
            FILTER (
                ALLEXCEPT ( Table3, Table3[item#] ),
                Table3[Payment date] < MAX ( Table3[Payment date] )
            )
        ),
    1,
    0
)

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @dedmondson,

 

Create a measure, add it to visual level filter and set its value to 1.

check status =
IF (
    SELECTEDVALUE ( Table3[Status] )
        = CALCULATE (
            LASTNONBLANK ( Table3[Status], 1 ),
            FILTER (
                ALLEXCEPT ( Table3, Table3[item#] ),
                Table3[Payment date] < MAX ( Table3[Payment date] )
            )
        ),
    1,
    0
)

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Community Champion
Community Champion

Sample data would help, but probably something along the lines of:

 

Measure =
VAR __paymentDate = MAX('Table'[Payment Date])
VAR __item = MAX('Table'[Item #])
VAR __status = MAX('Table'[Status])
VAR __lastDate = MAXX(FILTER('Table',[Item #]=__item && MONTH([Payment Date]) + 1 = MONTH(__paymentDate) && YEAR(__paymentDate)=YEAR([Payment Date])),[Payment Date])
VAR __lastStatus = MAXX(FILTER('Table',[Item #]=__item && [Payment Date] = __lastDate),[Status])
RETURN IF(__status <> __lastStatus,1,0)

 

Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



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...

getting there I think...working on it... but you use the VAR expression,w hich one, there are 4 in the DAX measure builder?

 

Var.p

VAR.s

VARX.p

Varx.s

 

Nope, just VAR. This creates a variable.



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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors