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

Seleccione la fecha en el mismo mes 1er promedio

Hola equipo,

Tengo 5 columnas similares

FechaCountry_NameContarBPIDRES/NOT
20-Mayo-20India20Z10RES
20-Mayo-20India15Z12NONRES
20-Mayo-20América10z12RES
20-Mayo-20Sudáfrica30Z10RES
21-Mayo-20India25Z10RES
21-Mayo-20India25Z14RES
21-Mayo-20América10Z12RES
21-Mayo-20Sudáfrica25Z15NONRES
24-Mayo-20India30Z20NONRES
24-Mayo-20India34Z20RES
24-Mayo-20América10Z35RES
24-Mayo-20Sudáfrica34Z10

NONRES

Necesito Si selecciono una fecha el mismo mes 1a fecha promedio requerido (promedio de formala -SUM(countcolumn values)/COUNT(no .of dates)

Si estoy seleccionando 24o mayo los datos disponibles 21 entonces shoube salida INDIA (20 +15 +25 +25 +30 +34)/3-49.6

si estoy seleccionando jan 27 entonces promedio shoube 01-jan a 27-jan

si estoy seleccionando 15-jan entonces promedio shoulbe 01-jan a 15-jan

similar seleccionar fecha al mismo mes 1er promedio requerido por favor ayúdame.

si estoy seleccionado 20-Feb entonces promedio shoulbemonth 01-feb a 20-15

Gracias

Shanvitha

1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hola @Shanvitha01 ,

Al principio, utilice DISTINCT() para crear una tabla de dimensiones de fecha basada en la tabla de hechos.

A continuación, consulte la siguiente medida:

Measure =
VAR a =
    SELECTEDVALUE ( 'Date'[Date] )
VAR b =
    CALCULATE (
        MIN ( 'Table'[Date] ),
        FILTER ( 'Table', 'Table'[Column] = SELECTEDVALUE ( 'Date'[Column] ) )
    )
VAR total =
    CALCULATE (
        SUM ( 'Table'[Count] ),
        FILTER ( 'Table', 'Table'[Date] >= b && 'Table'[Date] <= a )
    )
VAR day =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Date] ),
        FILTER ( 'Table', 'Table'[Date] >= b && 'Table'[Date] <= a )
    )
RETURN
    DIVIDE ( total, day )

Aquí está mi archivo de prueba para su referencia.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-eachen-msft
Community Support
Community Support

Hola @Shanvitha01 ,

Al principio, utilice DISTINCT() para crear una tabla de dimensiones de fecha basada en la tabla de hechos.

A continuación, consulte la siguiente medida:

Measure =
VAR a =
    SELECTEDVALUE ( 'Date'[Date] )
VAR b =
    CALCULATE (
        MIN ( 'Table'[Date] ),
        FILTER ( 'Table', 'Table'[Column] = SELECTEDVALUE ( 'Date'[Column] ) )
    )
VAR total =
    CALCULATE (
        SUM ( 'Table'[Count] ),
        FILTER ( 'Table', 'Table'[Date] >= b && 'Table'[Date] <= a )
    )
VAR day =
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Date] ),
        FILTER ( 'Table', 'Table'[Date] >= b && 'Table'[Date] <= a )
    )
RETURN
    DIVIDE ( total, day )

Aquí está mi archivo de prueba para su referencia.

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.
amitchandak
Super User
Super User

@Shanvitha01, ver como usted está buscando mes hasta la fecha, Usted tiene totalmtd y datesmtd para ayudar. Utilícelos con una tabla de fechas

Ejemplos

Ventas MTD: CALCULATE(Sum(Sales[Sales Amount]),DATESMTD('Date'[Date]))

MTD DatesTM CALCULATE(distinctcount(Sales[Sales Date]),DATESMTD('Date'[Date]))

Promedio de la división([Ventas MTD],[Fechas MTD])

Para obtener lo mejor de la función de inteligencia del tiempo. Asegúrese de que tiene un calendario de fechas y que se ha marcado como la fecha en la vista de modelo. Además, únase a ella con la columna de fecha de su/s hecho/s. Consulte:
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Vea si mi seminario web sobre Time Intelligence puede ayudar: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Apreciamos tus Felicitaciones.

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.