cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## How to take difference of data from first day of last month with first day of previous last month

Hello Friends,

I stuck on some issues calculating the difference between two rows.

I have a running hour of equipment which is always increasing and data saved in excel on daily basis.

I wast BI to calculate the difference from the first day of every month.

I want to calculate the yellow highlighted rows.

Thanks

Asif

4 REPLIES 4
Community Support

Hi @Anonymous ,

Did the above post solve your problem?

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Anonymous
Not applicable

or just assume i want to take a difference of each rows, last-previous

Memorable Member

Hi,

If I understood correctly, You want to calculate the amount for the first of the month - Amount for the first of the previous month.

For this purpose you could use the below code for creating the measure :

Hoist Diff =
Var __FistOfMonthVal = CALCULATE(values(Sheet68[hoist]), STARTOFMONTH(Sheet68[Date]))
Var __PreviousMonthVal = CALCULATE(sum(Sheet68[hoist]), DATEADD( STARTOFMONTH(Sheet68[Date]), -1, MONTH))
var Result = __FistOfMonthVal - __PreviousMonthVal
Return Result

Appreciate your Kudos and please mark it as a solution if it helps you.

Mahyartf
Super User

Hi,

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

Visit my LinkedIn page by clicking here.

Schedule a meeting with me to discuss further by clicking here.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

#### Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors