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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
Anonymous
Not applicable

Nueva tabla con columnas variables y personalizadas

Hola a todos,

Estoy tratando de crear una nueva tabla usando una vía viariable (parte fácil) con columnas personalizadas (parte dura)

1o paso, crear una tabla de calendario, funciona bien :

a_calendrier_global =
    VAR _mon_calendrier_ =
            CALENDAR(FIRSTDATE(t_intervention[int_date_programmation].[Date])
                    ;LASTDATE(t_intervention[int_date_programmation].[Date]))
 
RETURN
        _mon_calendrier_


2o paso, sé que quiero añadir una columna personalizada, así que intenté :

a_calendrier_global =
    VAR _mon_calendrier_ =
            CALENDAR(FIRSTDATE(t_intervention[int_date_programmation].[Date])
                    ;LASTDATE(t_intervention[int_date_programmation].[Date]))

RETURN
        SELECTCOLUMNS(
            _mon_calendrier_
            ; "date"; [Date]
            ; "test"; "Hello world !"
        )

pero realmente no funciona, estoy teniendo un error (en inglés algo así como La colonne "date" dans la table "a_calendrier_global" continent des liaisons non valides), también incluso intenté usando SUMMARIZE(_mon_calendrier;[ Fecha]), mismo resultado

¿Qué he perdido o malinterpretado?

Gracias por tiempo.

2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hola @SamOPEN ,

Lo siento por eso, pero no podemos reproducir este problema de mi lado con su código DAX compartido,

Creamos una tabla "t_intervention" de ejemplo y, a continuación, creamos dos tablas calculadas con el código, obtuvimos el resultado como sigue,

31.png32.png

También podemos usar la función ADDCOLUMNS para agregar una columna a las tablas, como las siguientes:

a_calendrier_global =
VAR _mon_calendrier_ =
    CALENDAR (
        FIRSTDATE ( t_intervention[int_date_programmation].[Date] );
        LASTDATE ( t_intervention[int_date_programmation].[Date] )
    )
RETURN
ADDCOLUMNS ( _mon_calendrier_; "test"; "Hello world !" )

¿Podría reproducir este problema con la versión más reciente de Power BI Desktop? Si no contiene ninguna información confidencial, por favor, proporcione una captura de pantalla que contiene información de error.

BTW, pbix como adjunto.


Saludos

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Ahora funciona... No sé qué pasó, lo siento por el post...
Pero gracias por su tiempo !

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors
Top Kudoed Authors