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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ssaintlouis
Frequent Visitor

Next item of the base field

I got that with that measure : CALCULATE(sum(BalanceVerification[MENSUEL]),'Dim_rubriquecptes'[Type compte]="REVENUS",
ALLEXCEPT(BalanceVerification,BalanceVerification[EXERCICE_Name]))

ssaintlouis_0-1710697191542.png

How to get That ?

ssaintlouis_1-1710697252288.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ssaintlouis ,

 

This is my test data.  

vtangjiemsft_0-1710917251288.png

We can create two measures.

index = RANKX(ALLSELECTED('Table1'),[Item],MAX('Table1'[Item]),ASC,Dense)
Test2 = var a=[index]+1
return CALCULATE([Test1],FILTER(ALLSELECTED(Table1),[index]=a))

vtangjiemsft_1-1710917326094.png

Best Regards,

Neeko Tang

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

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @ssaintlouis ,

 

You can use the SAMEPERIODLASTYEAR() function.

Measure2 =CALCULATE (
            [Measure],
            SAMEPERIODLASTYEAR ( 'Date'[Date] ) 

 In order to use any time intelligence calculation, you need a well-formed date table. For more details, please refer:

SAMEPERIODLASTYEAR – DAX Guide

Differences between DATEADD and PARALLELPERIOD in DAX - SQLBI

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Hi,

 

No, I don't have date field. The field BalanceVerification[EXERCICE_Name] is in text format. I want to show the next category for each item category in the field BalanceVerification[EXERCICE_Name] (Ex. 2022-2023, Ex. 2021-2022, Ex. 2020-2021, etc.) as I said. 
What can I change in this measure?
ContRev := CALCULATE(sum(BalanceVerification[MENSUEL]),'Dim_rubriquecptes'[Type compte]="REVENUS",
ALLEXCEPT(BalanceVerification,BalanceVerification[EXERCICE_Name]))

I work with Power Pivot in Excel 365.

Anonymous
Not applicable

Hi @ssaintlouis ,

 

We can create measures.

Measure 1 = INT(RIGHT(MAX(BalanceVerification[EXERCICE_Name]),4))
Measure 2 = var a=[Measure 1]-1
return CALCULATE([ContRev],FILTER(ALLSELECTED(BalanceVerification),[Measure 1]=a))

Then the result is as follows.

vtangjiemsft_0-1710837624826.png

Best Regards,

Neeko Tang

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

 

I got Test1 with this measure
Test1:=CALCULATE([ContFact],ALLEXCEPT(Table1,Table1[Item]))
How about Test2
Test1 is the total of each item. I want in Test2 the total of the next Item like this 

ssaintlouis_0-1710910446873.png

 

Anonymous
Not applicable

Hi @ssaintlouis ,

 

This is my test data.  

vtangjiemsft_0-1710917251288.png

We can create two measures.

index = RANKX(ALLSELECTED('Table1'),[Item],MAX('Table1'[Item]),ASC,Dense)
Test2 = var a=[index]+1
return CALCULATE([Test1],FILTER(ALLSELECTED(Table1),[index]=a))

vtangjiemsft_1-1710917326094.png

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.