Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
EDIT: Better way with no index, but I'm leaving my previous reply there. The Index method would allow you to move up/down by any number of rows you wish. Below will only move up to the previous date, but doesn't require an index to do this.
Use this calculated column (final edit - got rid of EARLIER altogether - Variables are better - didn't upload new image, so you can see the earlier EARLIER formula):
Previous 2 =
VAR CurrentDate = Data[Date]
VAR PreviousDate =
CALCULATE(
LASTDATE(Data[Date]),
FILTER(Data,
Data[Date] < CurrentDate
)
)
RETURN
CALCULATE(
MAX(Data[Users]),
FILTER(
Data,
Data[Date] = PreviousDate
)
)
Index method:
If you can create an Index column in Power Query this will help.
Then Add this custom column in the table:
Previous =
CALCULATE(
MAX(Data[Users]),
FILTER(
Data,
Data[Index] = EARLIER(Data[Index],1) -1
)
)
You'll have this:
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingHi @Anonymous ,
First, add a [index] column in Edit Queries;
Second, create the measure:
Measure 4 =
VAR x =
CALCULATE(
MIN(Sheet2[Users]),
FILTER(
ALLSELECTED(Sheet2),
Sheet2[Date] < MAX(Sheet2[Date]) && Sheet2[Index] = MAX(Sheet2[Index]) + 1
)
)
RETURN
IF(
x = BLANK(),
0,
x
)
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.
This work for me, thank you sir
Hi @Anonymous ,
First, add a [index] column in Edit Queries;
Second, create the measure:
Measure 4 =
VAR x =
CALCULATE(
MIN(Sheet2[Users]),
FILTER(
ALLSELECTED(Sheet2),
Sheet2[Date] < MAX(Sheet2[Date]) && Sheet2[Index] = MAX(Sheet2[Index]) + 1
)
)
RETURN
IF(
x = BLANK(),
0,
x
)
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.
EDIT: Better way with no index, but I'm leaving my previous reply there. The Index method would allow you to move up/down by any number of rows you wish. Below will only move up to the previous date, but doesn't require an index to do this.
Use this calculated column (final edit - got rid of EARLIER altogether - Variables are better - didn't upload new image, so you can see the earlier EARLIER formula):
Previous 2 =
VAR CurrentDate = Data[Date]
VAR PreviousDate =
CALCULATE(
LASTDATE(Data[Date]),
FILTER(Data,
Data[Date] < CurrentDate
)
)
RETURN
CALCULATE(
MAX(Data[Users]),
FILTER(
Data,
Data[Date] = PreviousDate
)
)
Index method:
If you can create an Index column in Power Query this will help.
Then Add this custom column in the table:
Previous =
CALCULATE(
MAX(Data[Users]),
FILTER(
Data,
Data[Index] = EARLIER(Data[Index],1) -1
)
)
You'll have this:
DAX is for Analysis. Power Query is for Data Modeling
Proud to be a Super User!
MCSA: BI ReportingThis was SO helpful, thank you!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 40 | |
| 38 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 34 | |
| 33 | |
| 30 |