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
Syndicate_Admin
Administrator
Administrator

Value Calculation between relative dates

Hello community!

I need to use in my dashboard a comparison of time recorded by users and compare it with the previous month. For this, I chose to use the meter visual.

For informational purposes, the structure of the database is as follows.

UsersDatesValues
Usuario114/07/23110
Usuario128/06/23120
Usuario214/07/23130
Usuario207/07/23140
Usuario213/06/23150

Now, I have trouble generating a quick measure for this case. I need that, within the visual "Meter" the "Value" is the data of the current month, but the destination value is the sum of the column "Values" of the last month.

Does anyone have any idea how I can represent it correctly visually? Is it correct to use that visual to represent it?

I look forward to your comments,

Best regards.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Procito0o ,

 

You can try below measure to get the previous month value.

PreviousMonthValue = CALCULATE(SUM('Table'[Values]),FILTER(ALLSELECTED('Table'),[Users]=MAX('Table'[Users])),PREVIOUSMONTH('Table'[Dates]))

vstephenmsft_0-1691484246560.png

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Procito0o ,

 

You can try below measure to get the previous month value.

PreviousMonthValue = CALCULATE(SUM('Table'[Values]),FILTER(ALLSELECTED('Table'),[Users]=MAX('Table'[Users])),PREVIOUSMONTH('Table'[Dates]))

vstephenmsft_0-1691484246560.png

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

 

AmiraBedh
Super User
Super User

Firstly, ensure that the "Dates" column is recognized as date type. If not, you will need to convert it. You can do this using the Power Query Editor, or by simply changing the data type in the Fields pane.

Then create a measure to get the sum of values for the current month:

Current Month Total =
CALCULATE(
SUM('Table'[Values]),
'Table'[Dates] >= EOMONTH(TODAY(), -1) + 1,
'Table'[Dates] <= EOMONTH(TODAY(), 0)
)


This measure will calculate the sum of "Values" for all dates within the current month.

Then create another measure to get the sum of values for the previous month:

 

Previous Month Total =
CALCULATE(
SUM('Table'[Values]),
'Table'[Dates] >= EOMONTH(TODAY(), -2) + 1,
'Table'[Dates] <= EOMONTH(TODAY(), -1)
)


This measure will calculate the sum of "Values" for all dates within the previous month.


- Put the "Current Month Total" measure in the "Value" field.
- Put the "Previous Month Total" measure in the "Target Value" field.

This will provide a comparison of the total value for the current month versus the previous month.

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
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.

Top Solution Authors
Top Kudoed Authors