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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
aakgun
Frequent Visitor

Help using Earlier in New Measure

Hello,

 

I need to have measure that will display dynamic values according to specific rows.

 

I have created similar logic in custom data column using Earlier function. But while creaitng same code in Measure. I get error messages

""

 

Percentage2.png

 

Here [AnaHesap] is the Row Colunm, when the row is about the data tbl_FinansButceKarsilastirma[Ana Hesap]="TOPLAM %" then

the data clolum in row tbl_FinansButceKarsilastirma[Ana Hesap]="NET" is used

 

 This custom data colum generate usage with EARLIER is not supported I think.

 

Column=

if (

tbl_FinansButceKarsilastirma[Ana Hesap]="TOPLAM %",
 SUMX(FILTER('tbl_FinansButceKarsilastirma',  tbl_FinansButceKarsilastirma[Ana Hesap]="TOPLAM NET"

&&  tbl_FinansButceKarsilastirma[SUBEADI]=EARLIER(tbl_FinansButceKarsilastirma[SUBEADI])

), 'tbl_FinansButceKarsilastirma'[DÖNEM MİKTARI] )

,tbl_FinansButceKarsilastirma[DÖNEM MİKTARI])

 

the aim is to calculate the Percentage value using the data in seperate two rows and display this percentage value in "Data %" column

 

OranHesapKolon = if (tbl_FinansButceKarsilastirma[Ana Hesap]="TOPLAM %",
   SUMX(FILTER('tbl_FinansButceKarsilastirma',  tbl_FinansButceKarsilastirma[Ana Hesap]="TOPLAM NET" &&              tbl_FinansButceKarsilastirma[SUBEADI]=EARLIER(tbl_FinansButceKarsilastirma[SUBEADI])                 && tbl_FinansButceKarsilastirma[BUTCE_AY]=EARLIER(tbl_FinansButceKarsilastirma[BUTCE_AY]))                  ,           'tbl_FinansButceKarsilastirma'[DÖNEM MİKTARI]
 ) / SUMX(FILTER('tbl_FinansButceKarsilastirma',  tbl_FinansButceKarsilastirma[Ana Hesap]="TOPLAM GELİR" &&              tbl_FinansButceKarsilastirma[SUBEADI]=EARLIER(tbl_FinansButceKarsilastirma[SUBEADI])                 && tbl_FinansButceKarsilastirma[BUTCE_AY]=EARLIER(tbl_FinansButceKarsilastirma[BUTCE_AY]))                  ,           'tbl_FinansButceKarsilastirma'[DÖNEM MİKTARI]
 ) *100 ,tbl_FinansButceKarsilastirma[DÖNEM MİKTARI])

3 REPLIES 3
aakgun
Frequent Visitor

Simply, is there any suggestion how can I use EARLIER funciton while creating new measure , it works fine creating column but, in measure I could not have any way ..

@aakgun

 

A simple demo to show how apply EARLIER in a measure.

 

RunningTotal Measure = CALCULATE(
SUM( Table1[amount] ),
FILTER(  ALL(Table1) ,
SUMX( FILTER( Table1, EARLIER( Table1[date] ) <= Table1[date] ), Table1[amount] )
)
)

 Capture.PNG

 

Due to low definition of the snapshots in your original post, I can't get what is the error message. If possible, upload your pbix with sample data, it can help to make your question more clear.

The sample code provided works as advertised and was exactly what I needed, but I hate to use something I don't understand and this is in that category.

 

My understanding of the FILTER function is that the second parameter must be a Boolean expression.  When I look at the top level FILTER function in the sample code, it uses SUMX as it's filtering expression, which I think would evaluate to a numerical result rather than a Boolean one.  What am I missing?

 

I have looked at lot of other FILTER examples and I have yet to find something else like this.  Can you shed some light on how and why this works?

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.