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
Syndicate_Admin
Administrator
Administrator

¿La tabla de fechas no funciona cuando me conecto con la tabla de hechos?

Hola

Tengo una tabla a continuación que proviene de AWS RDS

bourne2000_0-1643875486654.png

En mi tabla la fecha mínima es el 1 de diciembre de 2021. Sin embargo, he creado la tabla de datos desde el 1 de enero de 2020 hasta la fecha. Usé M Query y se actualiza automáticamente

Cuando conecto la tabla de fechas y mis datos, se trata de una sola relación.

bourne2000_1-1643875652505.png

Cuando arrastro la columna de fecha de fecha y Ventas, Artículo no de la tabla de datos, obtengo el siguiente resultado. No viene correctamente

bourne2000_2-1643875813128.png

No estoy recibiendo la fecha. Revisé mi tabla de fechas y es correcta.

¿Alguien puede aconsejar cuál es el problema? ¿Hay algún problema en la conexión de los datos con la base de datos?

PbIX adjunto aquí https://we.tl/t-8sOyWt9pSK

1 ACCEPTED SOLUTION

El problema no está en la TABLA DE FECHAS sino en la TABLA DE VENTAS. Si intenta crear CorrectDate en SALES con la fórmula dax

Fecha correcta = DATEVALUE(Datos[Fecha])

y cancelar la relación actual y crear la nueva entre Sales[CorrectDate] y Date[Date] ewerything está bien.

View solution in original post

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

Hola, el problema es con sus datos [Fecha].

Si utiliza

Fecha correcta = DATEVALUE(Datos[Fecha])
En lugar de
Datos[Fecha]
todas funcionan.
Si esta publicación es útil para ayudarlo a resolver su problema, considere darle a la publicación un pulgar hacia arriba y aceptarla como una solución.

@serpiva64 gracias por su respuesta. Utilicé la consulta M para crear una tabla de fechas. No estoy entendiendo su punto de vista

let

    Source = List.Dates,
    #"Invoke function" = Source(#date(2020, 01, 01), Duration.Days(DateTime.Date(DateTime.FixedLocalNow())- #date(2020, 01, 01))+1, #duration(1, 0, 0, 0)),
  
    #"List to table" = Table.FromList(#"Invoke function", Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    
    Date = Table.RenameColumns(#"List to table",{{"Column1", "Date"}}),
 
    #"Day Added" = Table.AddColumn(Date, "DayNo", each Text.PadStart(Number.ToText(Date.Day([Date])),2,"0")),
  
    #"Day Name Added" = Table.AddColumn(#"Day Added", "Day Name", each Date.ToText([Date],"ddd","en-US")),
    #"Month No Added" = Table.AddColumn(#"Day Name Added", "Month No", each Date.Month([Date])),

    #"Month Name Added" = Table.AddColumn(#"Month No Added", "Month Name", each Date.ToText([Date],"MMM","en-us")),

    #"Quarter No Added" = Table.AddColumn(#"Month Name Added", "Quarter No", each Date.QuarterOfYear([Date])),

    #"EUROPEAN Week No added" = Table.AddColumn(#"Quarter No Added", "WeekNo", each Text.PadStart(Number.ToText(Date.WeekOfYear([Date])+1),2,"0")),

    #"Year Added" = Table.AddColumn(#"EUROPEAN Week No added", "Year", each Date.Year([Date])),

    #"Year Month Added" = Table.AddColumn(#"Year Added", "Year-Month", each Number.ToText([Year])&"-"&[Month Name]),
    #"Year Week Added" = Table.AddColumn(#"Year Month Added", "Year-Week", each Number.ToText([Year])&"-"&[WeekNo]),

    #"Year Quarter Added" = Table.AddColumn(#"Year Week Added", "Year-Quarter", each Number.ToText([Year]) & "Q"& Number.ToText([Quarter No],"00")),

    #"Change type to text" = Table.TransformColumnTypes(#"Year Quarter Added",{{"Year", Int64.Type}, {"Date", type date}, {"Month No", Int64.Type}, {"Day Name", type text}, {"Month Name", type text}, {"Quarter No", Int64.Type}, {"Year-Quarter", type text}, {"Year-Month", type text}, {"WeekNo", Int64.Type}, {"DayNo", type text}, {"Year-Week", type text}}),

    #"Sort DayName" = Table.AddColumn(#"Change type to text", "SortDayName", each Date.DayOfWeek([Date],1)),

    #"Sort YearMonth" = Table.AddColumn(#"Sort DayName", "SortYearMonth", each Number.ToText([Year])&Text.PadStart(Number.ToText([Month No]),2,"0")),
    #"Sort YearWeek" = Table.AddColumn(#"Sort YearMonth", "Sort YearWeek", each Number.ToText([Year])&Text.PadStart(Number.ToText([WeekNo]),2,"0")),

    #"Sort YearQuarter" = Table.AddColumn(#"Sort YearWeek", "SortYearQuarter", each Number.ToText([Year])&Text.PadStart(Number.ToText([Quarter No]),2,"0")),

    #"Changed Type to NO" = Table.TransformColumnTypes(#"Sort YearQuarter",{{"SortYearMonth", Int64.Type}, {"SortYearQuarter", Int64.Type}, {"SortDayName", Int64.Type}, {"Sort YearWeek", Int64.Type}, {"Year-Week", type text}})
in
    #"Changed Type to NO"

El problema no está en la TABLA DE FECHAS sino en la TABLA DE VENTAS. Si intenta crear CorrectDate en SALES con la fórmula dax

Fecha correcta = DATEVALUE(Datos[Fecha])

y cancelar la relación actual y crear la nueva entre Sales[CorrectDate] y Date[Date] ewerything está bien.

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.

Top Solution Authors