Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
Hi community
I have a dataset where the last entry against a date is 01.09.2022. My current date table (below) returns a date table with the last date 31.12.2022.
How would i change this so it returns the maximum date in the dataset and not the final day of the year of this date ?
Solved! Go to Solution.
Let's say the date field in your fact table is called 'FactTable'[Date]
You can limit the start and end date in the calendar table by using:
Date Table =
VAR _MinDate =
MIN ( FactTable[Date] )
VAR _MaxDate =
MAX ( FactTable[Date] )
RETURN
ADDCOLUMNS (
CALENDAR ( _MinDate, _MaxDate ),
"YEAR", YEAR ( [Date] ),
"Month", FORMAT ( [Date], "mmmm" ),
"MONTH NUMBER", MONTH ( [Date] )
)
Proud to be a Super User!
Paul on Linkedin.
Let's say the date field in your fact table is called 'FactTable'[Date]
You can limit the start and end date in the calendar table by using:
Date Table =
VAR _MinDate =
MIN ( FactTable[Date] )
VAR _MaxDate =
MAX ( FactTable[Date] )
RETURN
ADDCOLUMNS (
CALENDAR ( _MinDate, _MaxDate ),
"YEAR", YEAR ( [Date] ),
"Month", FORMAT ( [Date], "mmmm" ),
"MONTH NUMBER", MONTH ( [Date] )
)
Proud to be a Super User!
Paul on Linkedin.
Thanks Paul - perfect 🙂
Hi @Caldowd98 ,
I don´t reccomend you to limit the rows of your calendar table to the last date of your fact table. You can have problems with time intelligence functions.
See here how a calendar table must be written:
https://community.powerbi.com/t5/Community-Blog/Time-Intelligence-Calendar-Table/ba-p/1000565
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
|---|---|
| 53 | |
| 40 | |
| 37 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 67 | |
| 34 | |
| 33 | |
| 30 |