Power Bi gives you the option to look at data by Year, Quarter, Month, and Day. I want the ability to look at data by 7 day periods that start on a specific date (not necessarily Monday or Sunday). How is the best way to accomplish this? I am guessing it will be with a measure but I can't quite figure out what the measure should look like?
Here I know I can assign a day of the week to each row and then use Week Day on my date axis. My problem is I need to be able to put "Tuesday" in the second parameter instead of either 1. Sunday or 2. Monday.
Week Number = WEEKNUM(Sheet1[Date],2)
Thank you in advance!
IIUC, the following might work:
Week number = WEEKNUM(DATEADD([Date],1,DAY),2)
Related
Relative Date Functionality in Power BI:
Issue #1:
Hi Team,
Need to know is there any way to implement the below relative date filter functionality in Power BI
Please note the following:
For year the base year should be current year, for now it should be 2021
For month the base month should be current month, for now it should be july and so on.
Issue#2:
Based on the above, we want to implement a functionality based on the below selection, where in if we select week, then we should see the count of a metric only for the weeks which are passed by the above filters and similarly for months, days etc. For eg, if we select year, then we should get the count for the year 2022 only as this is the only year passed by the above filter.
Thanks for any help!
Technically possible? I think so. Feasible? No, not really.
While there is some playroom with bookmarks, custom graphics and clever use of a wide range of measures and calculation groups - it would be an enormous task to get everything running correctly and smoothly.
Perhaps one option is to introduce this filtering functionality via a custom visual that takes your date column as input?
So, strange one to explain...
I have a table with the start dates of each person in project (each start day is the first Monday of the week)
I want to know how many people were in the project on any given week.
If I select two weeks in a slicer, for example
Week1
Week3
And there were 10 people in week 1 and 30 in week 3 the total should be 40.
How do I build a measure to do this.
Essentially I'm asking it to count the number of rows(project members) where the start date is >= each selected date and sum each individual result.
I hope this has made sense unable to share much due to work red tape
Thanks
Lloyd
I would do this in the following way:
Create a bin for the work week
Create a measure to count the bin from step 1.
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])))
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
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)