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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
flaviobdsti
Helper I
Helper I

Sum pending values with based on the previous month

Hi guys,

 

I'm trying to create a measure that shows me the sum of outstanding amounts in the current month based on the amounts that occurred in the previous month. I need to put this total amount on the card. Can you help me, please?

flaviobdsti_0-1671130732628.png

flaviobdsti_2-1671131541246.png

 

 

 

 




1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @flaviobdsti 

 

You can try the following methods.

vzhangti_0-1671180595322.png

Measure:

JAN = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),MONTH([Date])=1&&[ID]=SELECTEDVALUE('Table'[ID])))
FEB = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),MONTH([Date])=2&&[ID]=SELECTEDVALUE('Table'[ID])))

vzhangti_1-1671180639832.png

Measure = SUMX(FILTER(ALL('Table'),[FEB]=BLANK()&&MONTH([Date])=1),[JAN])

vzhangti_2-1671180682615.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

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

4 REPLIES 4
v-zhangti
Community Support
Community Support

Hi, @flaviobdsti 

 

You can try the following methods.

vzhangti_0-1671180595322.png

Measure:

JAN = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),MONTH([Date])=1&&[ID]=SELECTEDVALUE('Table'[ID])))
FEB = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),MONTH([Date])=2&&[ID]=SELECTEDVALUE('Table'[ID])))

vzhangti_1-1671180639832.png

Measure = SUMX(FILTER(ALL('Table'),[FEB]=BLANK()&&MONTH([Date])=1),[JAN])

vzhangti_2-1671180682615.png

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

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

Thanks a lot for the precious help.

vicky_
Super User
Super User

Is there any reason you can't do SUM(January) - SUM(February)?

It doesn't work because Jan (last month) and Feb (current month) are measured:

Current month = CALCULATE(SUM(BillsReceive[value_document]),GROUPBY(dimIDJ,dimIDJ[IDJ]))


Last month = CALCULATE([Current month],DATEADD(dimCalendar[Date],-1,MONTH))

I get the desired result only when I add the measures in a table and configure a filter on the screen for the current month (feb) = blank()

But I need to be able to do this in a measure to add to a card



Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.