Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi All,
I have a table which has dates column ( screenshot attached), I would like to calculate number of days in a month based on 22nd as start date. For example today is 8th Oct, so the total should be 16 . Any help on how can I achieve this would be greatly appriciated
Solved! Go to Solution.
Thanks for the reply from suparnababu8 and Kedar_Pande , please allow me to provide another insight:
Hi @biswad ,
Here are the steps you can follow:
1. Create measure.
Measure =
var _today=TODAY()
var _endday=
DATE(
YEAR(_today),MONTH(_today),22)
return
DATEDIFF(
_today,_endday,DAY)+2
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thanks for the reply from suparnababu8 and Kedar_Pande , please allow me to provide another insight:
Hi @biswad ,
Here are the steps you can follow:
1. Create measure.
Measure =
var _today=TODAY()
var _endday=
DATE(
YEAR(_today),MONTH(_today),22)
return
DATEDIFF(
_today,_endday,DAY)+2
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Create a Measure:
DaysLeftInMonth =
VAR CurrentDate = TODAY()
VAR StartDate = DATE(YEAR(CurrentDate), MONTH(CurrentDate), 22)
VAR EndDate = EOMONTH(StartDate, 0)
RETURN
IF(CurrentDate < StartDate,
0,
DATEDIFF(StartDate, EndDate, DAY)
)
Thank you for your help, but I'm getting zero days. So, basically I wanted to count number of days between today and 10/22/2024 ( Which is in the dates column)
Hi @biswad
DaysleftMeasure =
VAR CurrentDate = MAX([CalenderDateColumn])
VAR StartDate = IF(DAY(CurrentDate) >= 22, DATE(YEAR(CurrentDate), MONTH(CurrentDate), 22), DATE(YEAR(CurrentDate), MONTH(CurrentDate) - 1, 22))
RETURN
DATEDIFF(StartDate, CurrentDate, DAY)Try with this. Let me know If it works
Thank you for your reply, I'm still getting zero days.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 54 | |
| 47 | |
| 39 | |
| 16 | |
| 15 |
| User | Count |
|---|---|
| 83 | |
| 71 | |
| 39 | |
| 29 | |
| 27 |