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
Dora
Helper II
Helper II

How to get previous value for month filter

Hi All,

 

I get previous month Liabilty measure correctly as follows. But when I am using Month filter it gives a zero  value for each month.

How can I fix this error.

 

Before Selecting the Month Slicer:-

12.PNG

After Selecting the Month Slicer:-

123.PNG

Measure that used:-

Prev Month Liability =
VAR Currentindex=SELECTEDVALUE(GL_LEDGER_ACCESS[index 2])

RETURN
CALCULATE([Liability This Month],
FILTER(ALLSELECTED(GL_LEDGER_ACCESS),GL_LEDGER_ACCESS[index 2]= Currentindex-1))

 

(I do not use "date table" since my data set have random data with month not with date so I make a new index column for each month I have)

 

Please Help ,

Best Regards

Dora

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

Perhaps try:

 

Prev Month Liability =
VAR Currentindex=SELECTEDVALUE(GL_LEDGER_ACCESS[index 2])
RETURN
CALCULATE([Liability This Month],
FILTER(ALL(GL_LEDGER_ACCESS),GL_LEDGER_ACCESS[index 2]= Currentindex-1))

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

Perhaps try:

 

Prev Month Liability =
VAR Currentindex=SELECTEDVALUE(GL_LEDGER_ACCESS[index 2])
RETURN
CALCULATE([Liability This Month],
FILTER(ALL(GL_LEDGER_ACCESS),GL_LEDGER_ACCESS[index 2]= Currentindex-1))

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thank You ,It Worked.

Best Regards,

Dora

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.