I have a table with a column "Date" with different months and years.
I want to calculate the last month of each year. For example for 2018 year, my last month is october but in 2017, the last month is December, etc. How can I get this information?
I need this information because I have an slicer with the date but when I select '2016' the table shows me all the months of each year.
I want to get something like that:
Related
I have dimension tables fct_department, Date and fact table fct_billing. I want to get the sum of fct_billing_amount for each month of the year for the list of department and fct_billing_amount for the previous month. For example if I have fct_billing_amount as $12,000 for the Month of Nov 22, I also want to see the value for fct_billing_amount, which is $10,000 for the previous month. But when the fct_billing_amount data for the listed department is rolled-up or summarized to year, I should get the value for the year 2022 which is $1,20,000 along with the total of fct_billing_amount for the year 2021 which is $1,10,000 which is for the previous year.I am trying to achieve the output in Power BI. The required out should be as mentioned in the image Required output
How to get sales of Last Week, Last One Month, Last Six Month, Last Year sales based on selected weekending dates from slicer filter. By using DATESINPERIOD function I'm getting results for last week but when I'm using same function for last 1 Month, 3 Months, 6 Months & 1 Year it is giving me blank values. How to get values for this particular months.
This is how I'm doing my calculation.
enter image description here
It is giving me results for last week but not for previous months which I wanted.
Note: In my slicer I'm using WeekEnding Dates which look like these 22/01/2023, 15/01/2023, 08/01/20223.
Any help would be greatly appreciated. Thank you.
Apologises if this question has already been raised but I'm struggling with my data model to create a rolling total / YTD sales using fiscal years.
I know PowerBI/DAX is great using calendar Jan-Dec dates but how do you amend this if your financial year begins in March-April instead?
When I created my calendar table, I used the CALENDEARAUTO() which gave me a column of dates from Jan to Dec as expected and when I change the function to CALENDERAUTO(3), my date column begins from March to April which makes sense.
However, if I use the CALCULATE and DATESYTD functions to sum the total sales column and choose the date column as described above, the result looks like:
Actual YTD = CALCULATE(sum('spend'[Actual]),DATESYTD('Fiscal Year Table'[Date],"03-31"))
What do I need to do exactly for it work in this exact date format?
Many thanks
Hash
I have a requirement to display the current year 2019 (Actual), the previous year 2018 and 2 years ago 2017 sales data to be displayed on one Line chart. Sales data gets generated every Sunday of the week for a total of 52 weeks in a year
Note: Data is sensitive so not in a position to share it on the forum
Report requirement, two drop downs:
Market selection.
Date selection - This date will be each Sunday of a week
Line chart :
x-axis has the date and y-axis has the market. now when any week drop down is selected (eg: 31st March 2019 then there should be three trend lines in the line chart)
First trend line should display details from April 2019 to March 2020
Second trend line should display details from April 2018 to March 2019
Third trend line should display details from April 2017 to March 2018
Next challenge is I am unable to achieve 2nd and 3rd trend line for previous year and 2 years ago which should be overlapping each other so, total of three trend lines in one line chart.
Another challenge I am facing is dates are not continuous across years (Eg: Jan 2018 Sunday date was 7 and Jan 2019 Sunday date was 6).
Please let me know if any additional information is required.
The image below is how I want my line chart to look like. Instead of months I want date to display:
I have written a DAX which helps in displaying 1 year date range when a drop down is selected.
I want my line chart to display total three trend lines for current year,previous year and 2 years ago.
I have tried year functions to get previous year data but it does not overlap on my current trend line due to difference in date.
Does it have to have date resolution on the x-axis, if not you can use ISO-weeknumber as the x-axis and the year (or FY) as the explanation the line graph.
In your calendar table add this calculated column:
ISOweek = WEEKNUM([date]; 21)
If you need date resolution you can add two calculated columns; date+1year, and date+2years.
Add 364 days if day of the week is the important match or add 365 if date is.
Add two new relationships from your calendar to your data table, one to date+1year and one to date+2years. these will become passive (dashed lines).
Then use the following pattern:
A_measure =
MAXX(
DISTINCT(Calendar);
CALCULATE(
SUM(Table[Data]);
USERELATIONSHIP(Table[date+1year]; Calendar[Date])
// this uses the passive relationship instead of the active
)
)
An then a second measure in the same way but for the third relationship.
In the line diagram use the Calendar[Date] as x-axis and then all three years will overlay.
I have two slicers in my report. Year and 12 months.
If I look at the data by selecting year only, months are changing fine, according to year.
But if I choose Year 2017 and, lets say, December month, and then switch to Year 2018 - it will display two months of December at the end of the Month slicer.
Looks fine so far:
Choosing another year:
Is it some kind of a bug?
I am expecting it to switch to Dec 2018 if i switch a Year.
Data structure:
Link to .ipbx file:
https://www.dropbox.com/s/qo0hl1a6vulx0bf/User%20Open%20Closed%20Tasks.pbix?dl=0
Value for column Month displaying Month name and current year: Jan 2017. So I changed column Month to display just a month Name, without year and it works.