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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
vytas
Helper I
Helper I

Contexto de fecha de calendario

Hola

Hay una medida

Unpaid Invoice Days = 
VAR _tbl =
    FILTER (
        ADDCOLUMNS (
            SUMMARIZE (
                Debt;
                Debt[DocumentNo];
                Debt[KeyCode];
                Debt[PaymentDate]
            );
            "Saldo"; CALCULATE ( SUM ( Debt[Amount] ) );
            "InvoiceDate"; CALCULATE ( MAX ( Debt[DocumentDate] ) ) //For knowing which Date Invoice is unpaid 
        );
        [Saldo] > 0 // to filter Unpaid Invoices
    )
VAR _min = MINX ( _tbl; [InvoiceDate] )
VAR _max = MAXX ( _tbl; [InvoiceDate] )
RETURN
    CALCULATE (
        DATEDIFF ( _min; _max; DAY );
        FILTER (
            ALL ( 'Calendar'[Date] );
            'Calendar'[Date] >= MAX ( 'Calendar'[Date] )
        )
    )

Funciona bien, pero cuando lo pongo con la columna Calendario[Fecha] es mi _tbl filas. Traté de envolver DATEDIFF (_min; _max; DAY ) con el patrón CALCULATE FILTER ALL, pero no funciona. ¿Qué pasa?

pbix Sample file - https://1drv.ms/u/s!Ag3StL_v1twMoVIBrE0WPgoN3QT4?e=4MbQ5h

Gracias

3 REPLIES 3
dax
Community Support
Community Support

Hola @vytas ,

¿Tenías una relación entre dos tablas o cómo te diseñaste la mesa? Si es posible, ¿podría informarme información más detallada (como su salida esperada y sus datos de muestra (por OneDrive para la Empresa))? Entonces te ayudaré más correctamente.

Por favor, haga mask datos confidenciales antes de cargarlos.

Gracias por su comprensión y apoyo.
Saludos
Zoe Zhi

Si este post ayuda, por favor considere Aceptarlo como la solución para ayudar a los otros miembros a encontrarlo más rápidamente.

Hola

Hay un archivo de datos de ejemplo. Toda la información está ahí. https://1drv.ms/u/s!Ag3StL_v1twMoVIBrE0WPgoN3QT4?e=3vAIMv

Greg_Deckler
Super User
Super User

Difícil de decir. Por favor, consulte este post sobre cómo obtener su pregunta respondida rápidamente: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

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