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.
Hi,
I have a line graph to create and need it to show total of 3 years back from any date selected.
The data will also be filterable afterwards.
I need to create a seperate date table from an existing date table to use as a filter for the line graph.
How can achieve this such that the new date table is dynamic ie. minimum date is 3 years before maximum date of original table and the maximum is the maximum selected date on the original date table
Solved! Go to Solution.
Hi @Anonymous ,
If you need create a new data table you can use DAX CALENDAR(<start_date>, <end_date>) to do that.
Some dax code like the following:
New date table =
VAR _MIN =
MIN ( 'original date table'[Date] )
VAR _MAX =
MAX ( 'original date table'[Date] )
RETURN
CALENDAR ( DATE ( YEAR ( _MIN ), MONTH ( _MIN ), 1 ), _MAX )
Best regards.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
If you need create a new data table you can use DAX CALENDAR(<start_date>, <end_date>) to do that.
Some dax code like the following:
New date table =
VAR _MIN =
MIN ( 'original date table'[Date] )
VAR _MAX =
MAX ( 'original date table'[Date] )
RETURN
CALENDAR ( DATE ( YEAR ( _MIN ), MONTH ( _MIN ), 1 ), _MAX )
Best regards.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
You no need another date table. You can get from one single date table. If you DAX filter context then it will be simple.
Ref - https://blog.enterprisedna.co/show-days-before-or-after-a-selected-date-using-power-bi/
Thanks
Hari
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 |
---|---|
114 | |
99 | |
82 | |
70 | |
61 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |