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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Earlier function usage help with table field not measure

Hi Community, 

 

I have used Earlier function with a calculated measure before and it worked.

This time, i have a field "PeriodTCDCRank" which i want to use- but this field is in the table itself not a measure.

 

I am using the same field in the screenshot below- it accepts it with Filter (underlined with Green), but not with Earlier- please suggest what am i doing wrong!

Gguliani_0-1602850422019.png

I get the error even if i use quotes (') for Earlier around table name

Gguliani_0-1602850648858.png

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Are you trying to create a calculated column or measure? If it is measure , please use the following measure:

 

 

FoGByPeriodTCDCRank = CALCULATE(SUM('NewFoGSQL'[Feet on the Ground Total]),FILTER(ALLSELECTED('NewFoGSQL'),'NewFoGSQL'[PeriodTCDCRank]) = MAX('NewFoGSQL'[PeriodTCDCRank])))

 

If not, please explain more about Now, i am trying to do something similar but using a column in Power Query "PeriodTCDCRank" not column on Report View-

 

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

 

Best Regards,

Dedmon Dai

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , In filter you use allselected on you table and max in place of earlier

like

Filter(Allselected('NewfoGsql') ,'NewfoGsql'[periodcdrank] =max('NewfoGsql'[periodcdrank] ))

Anonymous
Not applicable

Thanks @amitchandak 

I got an error- can you please check

Gguliani_0-1602852266915.png

Context

Previously, i used EARLIER with a custom column (TC.Period.DC)- i used this formula- it worked

This column was calculated by concatenating text fields in Report View- 

TC.Period.DC = CONCATENATE('NewFoGSQL'[Traveler Country with China/ HK],concatenate([Period],[DestinationCountryName]))
 

Gguliani_1-1602852329531.png

Now, i am trying to do something similar but using a column in Power Query "PeriodTCDCRank" not column on Report View-

This field PeriodTCDCRank is a also text field created by merging 4 other text fields in the table.

And that's why my original query and even after trying your suggestion- i got this error shared above.

Please help!

Hi @Anonymous ,

 

Are you trying to create a calculated column or measure? If it is measure , please use the following measure:

 

 

FoGByPeriodTCDCRank = CALCULATE(SUM('NewFoGSQL'[Feet on the Ground Total]),FILTER(ALLSELECTED('NewFoGSQL'),'NewFoGSQL'[PeriodTCDCRank]) = MAX('NewFoGSQL'[PeriodTCDCRank])))

 

If not, please explain more about Now, i am trying to do something similar but using a column in Power Query "PeriodTCDCRank" not column on Report View-

 

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

 

Best Regards,

Dedmon Dai

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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