Last month Same period - powerbi

I'm struggling to get the same period of last month sum. I want to compare the current month period, for instance, i have data complete June, July and 1-10 Aug 2022 so I want to get the sales from last month 1st to July 10th.
Result required as per image paste

I was facing with the same issue, but then I found the link solution worked for me.
Dax Same period last months
Hope it helps!
Cheers

Related

How to use the EOMONTH DAX to get the last date of iso month?

ISO months start and end at various dates. Not necessarily 1st/31st.
How to use the EOMONTH DAX to get the last date of iso month?
DAX can handle everything that follows a certain logic.
In your example Jan is week 1-4, Feb is 5-8 and Mar is probably 9-12. But April has to be 13-17 (5 weeks), which ends on Apr-30? After all 52 weeks divided by 4 is 13 not 12. So some "months" have to have 5 weeks instead of 4.
I'm afraid EOMONTH is not familiar with your calendar preferences as long as they not defined in any ISO regulation.
However, as mentioned above, it's possible to find the first Monday and last Sunday within a month using DAX, but not with the EOMONTH function.

how to subtract months giving a specific criteria

hi I have a rolling last 12 months in excel but I would like to exclude specific months so that way it will skip does months on the report. but the formula that I have wont work for every month. the months that I would like to skip is march 2020, april 2020, may 2020, june 2020. I have a drop list I which it will subtract the last 12 months.
enter image description here

Cumulative/Rolling Sum Blank Dates

I'm currently working on inventory reconciliation, and I've struggling to fill all days of the calendar with the cumulative sum of product we're currently storing:
Inventory level ($). = CALCULATE(SUM(ledger[cost]),FILTER(ALL(DimDate[Date]),DimDate[Date]<=MAX(ledger[Document Date])))
As you guys might notice it has at least 90% of all dates filled, however if we look closely to the graph, we can appreaciate March 5th of 2016 is missing just due to the fact there was no transaction during that day resulting on a blank value. However I'm trying to accomplish retrieving the previous day balance for those days with no transactions. e.g: for March 5th should have $17,038,462.32 (balance for the previous day March 4th).
I'm trying to work on another clause into the measure with functions such as EARLIER or LASTDATE, however I haven't been succesful.
Any insight or solutions works well thank you. Have a nice day.
You are using a wrong date field in your measure. Change it to the field from the Date table:
Inventory level. =
CALCULATE(
SUM(ledger[cost]),
FILTER(ALL(DimDate[Date]),DimDate[Date]<=MAX(DimDate[Date])))

Calculate Daily Average Month To Date in PowerBI

In Power Bi my average matters per day is not stopping on the current day.
Avg Per Day = DIVIDE([Matters],SUM(Dates[IsWorkday]))
where IsWorkday = IF(ISBLANK(Dates[Holiday]),IF(Dates[DayOfWeekNumber]>1&&Dates[DayOfWeekNumber]<7,1,0),0)
and Matters = COUNT(BillingData[Item])
So today is the 27th of the month so 18 of 20 work days are completed for the
month. So need [matters]/18, not [matters]/20.
How do I factor that in to my average and not affect previous months.
Any help appreciated.
Sounds like you need to just add one more condition to your if statement to add in that the date is less than todays date. Check out this post. I think it might have the solution to your problem or at least give you the idea you need to solve the issue.
https://community.powerbi.com/t5/Desktop/Networkdays-DAX-function/td-p/38044

How to get the first day of current month measure with Year parameter in Power BI?

Seems like it should be very simple, but I still couldn't fine the way to get the first day of current month having parameter "Year"
So if parameter year 2018 - I need May 1,2018
if parameter year 2017 - need May 1, 2017
etc.
I tried to use DATE function, but the year will be dynamic.
How simply choose the first day of the month?
Thanks
I'm not sure how your year parameter is set up, but how about something along these lines?
FirstDayOfCurrentMonth = DATE([Year Parameter], MONTH(TODAY()), 1)