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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
PatriceGREN
Regular Visitor

Using PreviousDay

Hi,

PBI.png

I have a HISTORY table which contains 1 row per day with a repeated dataset until they change.
I'm looking for the syntax that will give me (according to the attached example)

4854 7/01/2020 20 and previous coefficient 15

I arrive at 4854 7/01/2020 20 but not the last data (15).

Thank you for your help,
Patrice

1 ACCEPTED SOLUTION

Hi @PatriceGREN ,

 

Just need to modify the following code.

Please refer to my .pbix file.

v-lionel-msft_0-1596534339195.png

v-lionel-msft_1-1596534371947.png

 

Best regards,
Lionel Chen

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

5 REPLIES 5
v-lionel-msft
Community Support
Community Support

Hi @PatriceGREN ,

 

Please create two measures.

Next_co = 
VAR Next_co = 
CALCULATE(
    MAX(Sheet1[Coefficient]),
    FILTER(
        ALLSELECTED(Sheet1),
        Sheet1[ID] = MAX(Sheet1[ID]) && Sheet1[Date] = MAX(Sheet1[Date]) - 1
    )
)
RETURN
Next_co
Changed Date = 
IF(
    MAX([Coefficient]) <> [Next_co] && [Next_co] <> BLANK(),
    MAX([Date])
)

111.PNG

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello and thank you,
When I try to put a filter on "Changed Date" to only show the changes, it doesn't display anything. In addition, I tried to make a difference between "Coefficient" and Nextco to know the amount of the increase.
I admit that the syntax I do not quite understand it, for that it does not work exactly with what I do

 

Greg_Deckler
Community Champion
Community Champion

@PatriceGREN - So funny, I just wrote a Quick Measure that includes PREVIOUSDAY - To **bleep** with NEXTDAY - https://community.powerbi.com/t5/Quick-Measures-Gallery/To-bleep-With-NEXTDAY/td-p/1245497



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

Hello,
I will need a little time to understand these functions and especially to be able to use them 🙂
I will work on it, thank you

Patrice

Hi @PatriceGREN ,

 

Just need to modify the following code.

Please refer to my .pbix file.

v-lionel-msft_0-1596534339195.png

v-lionel-msft_1-1596534371947.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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