Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Stop showing useless dates - Date intelligence

Hi,

 

I'm having trouble with a date variable. This variable is a workaround in SQL that only shows data from each monday of every week in the last 6 months:

 

SELECT *
FROM [MAC].[dbo].[Clientes_MAC]
where FechaCarga in (SELECT DATEADD(ww, DATEDIFF(ww,0,FechaCarga), 0))
and FechaCarga >= dateadd(month, -6, (select max(FechaCarga) from [MAC].[dbo].[Clientes_MAC]))

 

For some visualizations it only shows the available dates, but I'm trying to create a graph and FechaCarga has all the dates. Im more than sure that this is not the case because the query is working, so I want to know if there is a way to prevent the empty dates from showing.

 

 

Thanks in advance,

 

IC

1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can create calendar table to get all date like DAX below, then create relationship between this calendar table and your original table on date field, keep Cross filter direction as Both.

 

DateDim= CALENDARAUTO()

 

DateDim = CALENDAR(MIN(Data[DATE]),MAX(Data[DATE]))

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xicai
Community Support
Community Support

Hi @Anonymous ,

 

You can create calendar table to get all date like DAX below, then create relationship between this calendar table and your original table on date field, keep Cross filter direction as Both.

 

DateDim= CALENDARAUTO()

 

DateDim = CALENDAR(MIN(Data[DATE]),MAX(Data[DATE]))

 

Best Regards,

Amy

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.