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
BereniceMtz10
Frequent Visitor

Contar ciertos días de un mes

Buenas tardes, soy nueva en Power Bi.

Quiero calcular el total de los dias martes y jueves que contenga un mes.

Ejemplo: Julio/2021 tendria 9.

He tratado pero no he encontrado la manera de hacer que funcione

2 ACCEPTED SOLUTIONS
Syndicate_Admin
Administrator
Administrator

@Syndicate_Admin

Cree una medida de la siguiente manera, agregue una columna de mes de nuestra tabla de fechas y la medida

    Day Count = 
    var __lastdate =  MAX(Dates[Date])
    var __firstdate = EOMONTH(__lastdate,-1)+1
    return
    COUNTROWS(
        FILTER(
            CALENDAR(__firstdate,__lastdate),
            WEEKDAY([Date],1) IN {3,5}
        )
    )

Fowmy_0-1627501883451.png



:

View solution in original post

Muchas gracias!! Me funciono correctamente.

View solution in original post

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

@Syndicate_Admin

Cree una medida de la siguiente manera, agregue una columna de mes de nuestra tabla de fechas y la medida

    Day Count = 
    var __lastdate =  MAX(Dates[Date])
    var __firstdate = EOMONTH(__lastdate,-1)+1
    return
    COUNTROWS(
        FILTER(
            CALENDAR(__firstdate,__lastdate),
            WEEKDAY([Date],1) IN {3,5}
        )
    )

Fowmy_0-1627501883451.png



:

Muchas gracias!! Me funciono correctamente.

Syndicate_Admin
Administrator
Administrator

@Syndicate_Admin suponiendo que tiene una tabla de calendario en su modelo, si no, puede agregar una siguiendo mi entrada de blog Crear una tabla de fecha básica en su modelo de datos para cálculos de inteligencia de tiempo | Solu...

y ahora puede agregar la siguiente medida para contar el número de martes / jueves en un mes

Tuesday and Thursday Count =
CALCULATE ( COUNTROWS ( 'Calendar' ), WEEKDAY ( 'Calendar'[Date], 2 ) IN {2,4} )

Para visualizar, use el objeto visual de tabla, agregue Month desde la tabla de calendario y encima de la medida y obtendrá el recuento.

Síguenos en LinkedIn

Consulta mi última entrada de blog La potencia del uso de grupos de cálculo con relaciones inactivas (Parte 1) (perytus.com) Me gustaría elogios si mi solución ayudó. 👉 Si puede pasar tiempo publicando la pregunta, también puede hacer esfuerzos para dar Felicitaciones a quien ayudó a resolver su problema. ¡Es una muestra de agradecimiento!

Visítenos en https://perytus.com, su ventanilla única para proyectos, formación y consultoría relacionados con Power BI.

Syndicate_Admin
Administrator
Administrator

@Syndicate_Admin

Cree una medida de la siguiente manera, agregue una columna de mes de nuestra tabla de fechas y la medida

    Day Count = 
    var __lastdate =  MAX(Dates[Date])
    var __firstdate = EOMONTH(__lastdate,-1)+1
    return
    COUNTROWS(
        FILTER(
            CALENDAR(__firstdate,__lastdate),
            WEEKDAY([Date],1) IN {3,5}
        )
    )

Fowmy_0-1627501883451.png



:

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.