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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
hwoehler
Helper I
Helper I

get previous values per group

Hello everybody,
I would like to have the previous values ​​(see screenshot) displayed for the "ChangeWeek" column. So there should be a new column (see screenshot "new"), where the previous value per group (ISIN) is always displayed. It is important that it is a column, not a measure. I already got a solution in another post (https://community.powerbi.com/t5/Desktop/Get-weekly-values-and-previous-values/m-p/927847/highlight/...), but it's a measure there and not a column. Does anyone have a solution?

 

PBI File: https://we.tl/t-wYhdl5R56e
Best regards, hwoehler
screenshotscreenshot (Screenshot)

1 ACCEPTED SOLUTION

Try , as new columns

Column = maxx(filter('Table','Table'[ISIN]=EARLIER('Table'[ISIN]) && not(ISBLANK('Table'[ChangeWeek])) && 'Table'[Date]<EARLIER('Table'[Date])),'Table'[Date])

Column 2 = if(ISBLANK('Table'[ChangeWeek]),BLANK(),maxx(FILTER('Table','Table'[ISIN]=EARLIER('Table'[ISIN]) && ('Table'[Date])=EARLIER('Table'[Column])),('Table'[ChangeWeek])))

 https://www.dropbox.com/s/kexca62xapy8j41/Filter2.pbix?dl=0

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@hwoehler , can ypu let us know the logic of last column. Not very clear from the example

Hi @amitchandak ,

you're right. The screenshot is misleading. This screenshot should be better:
desired column "new"desired column "new"The column "new" consists of (always) the previous value. (based on column "ChangeWeek".
Best regards, hwoehler

Try , as new columns

Column = maxx(filter('Table','Table'[ISIN]=EARLIER('Table'[ISIN]) && not(ISBLANK('Table'[ChangeWeek])) && 'Table'[Date]<EARLIER('Table'[Date])),'Table'[Date])

Column 2 = if(ISBLANK('Table'[ChangeWeek]),BLANK(),maxx(FILTER('Table','Table'[ISIN]=EARLIER('Table'[ISIN]) && ('Table'[Date])=EARLIER('Table'[Column])),('Table'[ChangeWeek])))

 https://www.dropbox.com/s/kexca62xapy8j41/Filter2.pbix?dl=0

Yep, EARLIER.


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

So generally you are going to do this with something like EARLIER - See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/3395.... What is the measure calculation that fixed it? Should be very translatable to a column.


@ 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!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.