Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi Professionals..!!
Need help in understanding the dax for getting the last column data as measure, basically it is a fill down in dax.
Solved! Go to Solution.
Hi,
Please check the below and the attached pbix file.
Those are for both creating a measure and a calculated column.
Desired measure: =
VAR currentrows =
MAX ( Data[Rows] )
VAR currentdate =
MAX ( Data[Date] )
VAR startdate =
MINX (
FILTER ( ALL ( Data ), Data[Rows] = currentrows && Data[NewMC] <> BLANK () ),
Data[Date]
)
VAR previousdate =
MAXX (
FILTER (
ALL ( Data ),
Data[Rows] = currentrows
&& Data[Date] <= currentdate
&& Data[NewMC] <> BLANK ()
),
Data[Date]
)
VAR previousvalue =
MAXX (
FILTER ( ALL ( Data ), Data[Rows] = currentrows && Data[Date] = previousdate ),
Data[NewMC]
)
RETURN
IF (
HASONEVALUE ( Data[Rows] ),
IF ( MAX ( Data[Date] ) = startdate, SUM ( Data[NewMC] ), previousvalue )
)
Desired CC =
VAR currentrows = Data[Rows]
VAR currentdate = Data[Date]
VAR startdate =
MINX (
FILTER ( Data, Data[Rows] = currentrows && Data[NewMC] <> BLANK () ),
Data[Date]
)
VAR previousdate =
MAXX (
FILTER (
Data,
Data[Rows] = currentrows
&& Data[Date] <= currentdate
&& Data[NewMC] <> BLANK ()
),
Data[Date]
)
VAR previousvalue =
MAXX (
FILTER ( Data, Data[Rows] = currentrows && Data[Date] = previousdate ),
Data[NewMC]
)
RETURN
IF ( Data[Date] = startdate, Data[NewMC], previousvalue )
Hi,
Your pbix file has a page-filter.
Please try the below and check the attached file.
Mydesire =
VAR currentrows =
MAX ( Mydata[Rows] )
VAR currentdate =
MAX ( Mydata[Date] )
VAR startdate =
MINX (
FILTER ( ALLSELECTED( Mydata ), Mydata[Rows] = currentrows && Mydata[NewMC] <> BLANK () ),
Mydata[Date]
)
VAR previousdate =
MAXX (
FILTER (
ALLSELECTED ( Mydata ),
Mydata[Rows] = currentrows
&& Mydata[Date] <= currentdate
&& Mydata[NewMC] <> BLANK ()
),
Mydata[Date]
)
VAR previousvalue =
MAXX (
FILTER ( ALLSELECTED ( Mydata ), Mydata[Rows] = currentrows && Mydata[Date] = previousdate ),
Mydata[NewMC]
)
RETURN
IF (
HASONEVALUE ( Mydata[Rows] ),
IF ( MAX ( Mydata[Date] ) = startdate, SUM ( Mydata[NewMC] ), previousvalue )
)
https://drive.google.com/file/d/1CMFr0oRjq1rb8gdCas-5V5oEa_s606uW/view
@Jihwan_Kim please help us with this data as we are unable to get the correct result
Hi,
Your pbix file has a page-filter.
Please try the below and check the attached file.
Mydesire =
VAR currentrows =
MAX ( Mydata[Rows] )
VAR currentdate =
MAX ( Mydata[Date] )
VAR startdate =
MINX (
FILTER ( ALLSELECTED( Mydata ), Mydata[Rows] = currentrows && Mydata[NewMC] <> BLANK () ),
Mydata[Date]
)
VAR previousdate =
MAXX (
FILTER (
ALLSELECTED ( Mydata ),
Mydata[Rows] = currentrows
&& Mydata[Date] <= currentdate
&& Mydata[NewMC] <> BLANK ()
),
Mydata[Date]
)
VAR previousvalue =
MAXX (
FILTER ( ALLSELECTED ( Mydata ), Mydata[Rows] = currentrows && Mydata[Date] = previousdate ),
Mydata[NewMC]
)
RETURN
IF (
HASONEVALUE ( Mydata[Rows] ),
IF ( MAX ( Mydata[Date] ) = startdate, SUM ( Mydata[NewMC] ), previousvalue )
)
Hi,
Please check the below and the attached pbix file.
Those are for both creating a measure and a calculated column.
Desired measure: =
VAR currentrows =
MAX ( Data[Rows] )
VAR currentdate =
MAX ( Data[Date] )
VAR startdate =
MINX (
FILTER ( ALL ( Data ), Data[Rows] = currentrows && Data[NewMC] <> BLANK () ),
Data[Date]
)
VAR previousdate =
MAXX (
FILTER (
ALL ( Data ),
Data[Rows] = currentrows
&& Data[Date] <= currentdate
&& Data[NewMC] <> BLANK ()
),
Data[Date]
)
VAR previousvalue =
MAXX (
FILTER ( ALL ( Data ), Data[Rows] = currentrows && Data[Date] = previousdate ),
Data[NewMC]
)
RETURN
IF (
HASONEVALUE ( Data[Rows] ),
IF ( MAX ( Data[Date] ) = startdate, SUM ( Data[NewMC] ), previousvalue )
)
Desired CC =
VAR currentrows = Data[Rows]
VAR currentdate = Data[Date]
VAR startdate =
MINX (
FILTER ( Data, Data[Rows] = currentrows && Data[NewMC] <> BLANK () ),
Data[Date]
)
VAR previousdate =
MAXX (
FILTER (
Data,
Data[Rows] = currentrows
&& Data[Date] <= currentdate
&& Data[NewMC] <> BLANK ()
),
Data[Date]
)
VAR previousvalue =
MAXX (
FILTER ( Data, Data[Rows] = currentrows && Data[Date] = previousdate ),
Data[NewMC]
)
RETURN
IF ( Data[Date] = startdate, Data[NewMC], previousvalue )
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 9 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 19 | |
| 17 | |
| 11 |