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
koray
Helper V
Helper V

No puedo obtener el resultado como 21.5

Hola

Tengo una tabla en mi archivo de Excel que muestra el total de días laborables del mes en función de la fecha.

is_gunu.JPG

No veo el número total de días laborables como 21,5 en mi informe. Eso lo pone en 22. ¿Cómo lo arreglo?

sonuc.JPG

Gracias.

6 REPLIES 6
Syndicate_Admin
Administrator
Administrator

Allí, @koray

Me pregunto cómo es la medida. En función de su descripción, he creado datos para reproducir su escenario.

mesa:

b1.png

Calendario (una tabla calculada):

Calendar = CALENDARAUTO()

No hay ninguna relación entre dos tablas.

Puede crear dos medidas como se indica a continuación. Ambos se establecen como número decimal.

Working Days = 
var _date = SELECTEDVALUE('Table'[Date])
var _year = YEAR(_date)
var _month = MONTH(_date)
var _result = 
CALCULATE(
    DISTINCTCOUNT('Calendar'[Date]),
    FILTER(
        ALL('Calendar'),
        YEAR('Calendar'[Date])=_year&&
        MONTH('Calendar'[Date])=_month&&
        NOT(WEEKDAY('Calendar'[Date]) in {1,7})&&
        'Calendar'[Date]<_date
    )
)
return
IF(
    ISBLANK(_result),
    0,
    _result
)

Remain Working Days = 
var _date = SELECTEDVALUE('Table'[Date])
var _year = YEAR(_date)
var _month = MONTH(_date)
var _result = 
CALCULATE(
    DISTINCTCOUNT('Calendar'[Date]),
    FILTER(
        ALL('Calendar'),
        YEAR('Calendar'[Date])=_year&&
        MONTH('Calendar'[Date])=_month&&
        NOT(WEEKDAY('Calendar'[Date]) in {1,7})
    )
)
return
_result-[Working Days]+0.5

resultado:

b2.png

Saludos

Allan

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

jptak
Helper I
Helper I

¿En qué se establece el tipo de datos para esa columna en Power BI? Parece que puede estar establecido en Número entero.

Hola

Intenté muchas opciones, pero 😞

sonuc2.JPG

¿Cuál es el tipo de datos en Power Query?

¿Qué debería ser? Lo envié en la primera foto.

az38
Community Champion
Community Champion

@koray hola

Comprobar:

a) Cinta de herramientas de columna para la columna [Kalan Gun]

b) Tipo de fecha para [Kalan Gun] en Power Query. Debe ser número decimal


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.