Forum Discussion
create a period segment between two dates
Hi saben02 ,
According to your data model, I think your issue should be caused that 03/01/2017 is not in range 03/25/2017 to 05/25/2017 and there is only 03/01/2017 in your data model. So Power BI couldn't find date in March, it will return 04/2017. Here I suggest you to create a calendar table by CALENDAR() or CALENDARAUTO() function which with continuous date.
Then your measure should look like as below.
choix seg date P1 onglet cumul =
IF (
ISFILTERED ( 'Calendar'[Date] ),
"From " & FORMAT ( MIN ( 'Calendar'[Date] ), "MM/YYYY" ) & " to "
& FORMAT ( MAX ( 'Calendar'[Date] ), "MM/YYYY" ),
"All the period"
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- saben023 years agoFrequent Visitor
Hello, thank you so much for your reply.
This method solves my display problem but still doesn't show the data for the corresponding periods.
Indeed , if the user chooses a date other than the first of the month, I want it to display only the data for that month.
But here when I choose January 2, 2017 on my slicer, for example, it will take into consideration the data for the following month, i.e. February. ☹️