Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I need to create a measure that shows "real" first selected date in the table with periods (month-year).
For example: My selected date range is May 2020 to Dec 2020. If I have M-Y in columns, first selected date will change for each period: for May-2020 it is May 1, for Jun-2020 it is June 1, ..., for Dec-2020 it is Dec 1. I need the first date to show Jan 1 in all periodic columns:
How do I do that?...
Thank you in advance!
Evgeny
Solved! Go to Solution.
Hi @evgenynartakhov ,
Please try measure like below:
Measure =
VAR MIN_DATE = CALCULATE(MIN('Table'[Date]),ALLSELECTED('Table'))
VAR MONTH_DATE = CALCULATE(MIN('Table'[Date]),ALLSELECTED('Table'[Date]))
RETURN IF(MIN('Table'[Date])=MIN_DATE,DATE(YEAR(MIN_DATE),1,1),MONTH_DATE)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @evgenynartakhov ,
Please try measure like below:
Measure =
VAR MIN_DATE = CALCULATE(MIN('Table'[Date]),ALLSELECTED('Table'))
VAR MONTH_DATE = CALCULATE(MIN('Table'[Date]),ALLSELECTED('Table'[Date]))
RETURN IF(MIN('Table'[Date])=MIN_DATE,DATE(YEAR(MIN_DATE),1,1),MONTH_DATE)
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@evgenynartakhov
Hope you have a dates table, create the following measure and add it:
1st Date = STARTOFYEAR(Dates[Date])
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Thank you for the reply.
This gives me the first date in the calendar table, but not the first selected date... Date selections may also have multiple years, which complicates things more.
Regards,
Evgeny
@evgenynartakhov
I did not understand that any how can you try this measure?
CALCULATE (
MIN ( dates[Date]).
REMOVEFILTERS (dates)
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Still getting the period first dates instead of just May 1, 2020 in all periodic clumns...
Regards,
E
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
85 | |
67 | |
59 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |