Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hello experts,
I want to make my dates dynamic as per the current month.
Previously I was hard coding values as,
Example:
Solved! Go to Solution.
My suggestion is to:
1) Create a nice Calendar Table that you can connect to you "Fact" table
https://learn.microsoft.com/en-us/power-bi/guidance/model-date-tables
2) Use Time intelligence functions to calculate Sales MTD, QTD, YTD etc. Please find below and example:
Sales MTD = Calculate(
Sum(Sales_values),
DATESMTD(Date_Table[Day])
)
My suggestion is to:
1) Create a nice Calendar Table that you can connect to you "Fact" table
https://learn.microsoft.com/en-us/power-bi/guidance/model-date-tables
2) Use Time intelligence functions to calculate Sales MTD, QTD, YTD etc. Please find below and example:
Sales MTD = Calculate(
Sum(Sales_values),
DATESMTD(Date_Table[Day])
)
Thank you @Uspace87, above formula is working great for MTD calculations.
Could you please suggest the same for non mtd calculations such as below:
Fcast TPD =
VAR FcastTotalTonnes = CALCULATE(SUM('Budget'[Tonnes]), 'Budget'[Date] = DATE(2022,12,01))
VAR WDcurrentMonth = CALCULATE(AVERAGE('Budget'[WDAYS]),'Budget'[Date] = DATE(2022,12,01))
return
DIVIDE(FcastTotalTonnes,WDcurrentMonth,0)
In above formula you can see 'Budget'[Date] = DATE(2022,12,01) is the static date which we need to manually change when every new month starts.
Kindly suggest an idea to make above measure dynamic.
Thank you!
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 5 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 18 | |
| 14 | |
| 9 | |
| 8 | |
| 8 |