Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
So I have a calenderauto via DAX:
Now my data has 3 date fields.
Fields like Manufacturing Date and Use before date are messing up my min and max date that I want to have.
I want the calenderauto to only take dates from the reporting date field.
Is this possible?
Solved! Go to Solution.
@rpinxt , Then you can use of the calendar is best. auto-calendar has a different purpose
I usually force those date to go start and end of the year
CALENDAR(eomonth([MinRepDate], -1* Month([MinRepDate])) +1 ,eomonth([MaxRepDate] , 12 -1* Month([MinRepDate]) ))
Thanks @amitchandak , but yes this code works.
But as said there are 3 date fields in my data.
So this code finds the first date and the last date of all dates in these 3 fields.
I wanted it to take only the dates of 1 specific date field and autocalendar on that field only and not the other 2.
But I now solved it likes this without autocalendar:
@rpinxt , Then you can use of the calendar is best. auto-calendar has a different purpose
I usually force those date to go start and end of the year
CALENDAR(eomonth([MinRepDate], -1* Month([MinRepDate])) +1 ,eomonth([MaxRepDate] , 12 -1* Month([MinRepDate]) ))
@rpinxt , I tried it worked for me
Date =
var _weekday =3
var _left = _weekday -7
var _tab = ADDCOLUMNS(CALENDARAUTO(),"Month Year",format([Date],"MMM-YYYY"),
"Month Year Sort", FORMAT([Date], "YYYYMM"),
"Year", YEAR([Date])
,"QTR Year" , FORMAT([Date],"YYYY-\QQ"),
"Week Year", YEAR([Date]) *100 + WEEKNUM([date],2),
"Day", Today() - Weekday(Today(),1),
"Weekday" , WEEKDAY([date]),
"Week Start Date1" , [Date] + -1*WEEKDAY([Date])+1,
"Week End Date1" , [Date] + -1*WEEKDAY([Date])+7,
"Week Start Date" , [Date] + -1*if(WEEKDAY([Date])<=_weekday,WEEKDAY([Date],1)+_weekday,WEEKDAY([Date],1)+ _left)
)
return ADDCOLUMNS(_tab, "Week Rank" , Rankx(_tab,[Week Year], ,ASC,Dense))
What is the issue
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 3 | |
| 2 | |
| 1 |
| User | Count |
|---|---|
| 21 | |
| 14 | |
| 9 | |
| 5 | |
| 5 |