Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Greetings from sunny South Africa!
Please can someone help me with my first forum post.
I receive MONTHLY data updates.
On refresh, I need my report year to adjust accordingly
The forums mainly make refernece to Fiscal Years in the calendar table
As you can see, this is different from a fiscal year, as my REPORTING YEAR CHANGES EACH MONTH
(months are not set, like a fiscal, but change month to month)
Please advise best practice here
I am hoping for DAX that does not reference 365 days (as my data goes back 7 years and leap years are a problem)
And DAX I will only have to enter once, not update each month
This is my first PowerBI report I am building, and I am learning DAX slowly
Any and all assistance would be greatly appreciated!
Solved! Go to Solution.
In your scenario, you want to create the calendar table dynamically. Right?
First you should know that we can use TODAY() function to get current date. Then to achieve your requirement, you can refer to following DAX:
1. To create a 7 years calendar table based on today:
Table = CALENDAR(DATE(YEAR(TODAY())-7,MONTH(TODAY()),DAY(TODAY())),TODAY())
2. Get last 12 month:
Last 12 month = DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))
Also, you can change the date format in Data pane.
Thanks,
Xi Jin.
In your scenario, you want to create the calendar table dynamically. Right?
First you should know that we can use TODAY() function to get current date. Then to achieve your requirement, you can refer to following DAX:
1. To create a 7 years calendar table based on today:
Table = CALENDAR(DATE(YEAR(TODAY())-7,MONTH(TODAY()),DAY(TODAY())),TODAY())
2. Get last 12 month:
Last 12 month = DATE(YEAR(TODAY())-1,MONTH(TODAY()),DAY(TODAY()))
Also, you can change the date format in Data pane.
Thanks,
Xi Jin.
This will filter the fact based on the date dimension. Worked for me
Amount-Previous2Years = VAR Months = -24 VAR FromDate = CALCULATE(EOMONTH(MAX(DimDate[Full Date])+1, Months), FctSales) RETURN CALCULATE(SUM(FctSales[Amount]), DimDate[Full Date]>=FromDate)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
99 | |
69 | |
46 | |
39 | |
33 |
User | Count |
---|---|
163 | |
110 | |
61 | |
51 | |
40 |