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

Calcular No. de Weeks & No. de meses basados en la condición de medida

Buenos días a todos.

Necesito un cálculo de medida para contar el número de MONTH (medida 1) y el número de SEMANAS (medida 2) en el rango de condiciones de 10% a 90% para (Cantidad % Progreso Acumulado)

Tenga en cuenta que el % de cantidad de progreso acumulativo es un MEDIDA. Tengo una tabla de calendario que tiene las columnas Fecha, Mes y Fin de semana.

Intenté este cálculo, pero no funcionó para Counting No. de MESES -->

IF([% Complete_Qty]>-0.1 && [% Complete_Qty]<-0.9, DATEDIFF(FIRSTDATE(_Calendar[Date]),LASTDATE(_Calendar[Date]),MONTH),0)

Devuelve 0, funciona si cruzo los meses en la tabla.

¡¡Salud!!

By MonthPor mes

By WeekPor semana

1 ACCEPTED SOLUTION

Si desea contar meses, utilice VALUES(_Calendar[Month]) como tabla para el cálculo:

Numeros de números ( COUNTROWS(FILTER(VALUES(_Calendar[Month])), [% Complete_Qty]>-0.1 && [% Complete_Qty]<-0.9))

Si desea utilizar eso en la matriz anterior, es posible que deba agregar ALL() o el filtro ALLSELECTED allí también

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

5 REPLIES 5
AllisonKennedy
Super User
Super User

@hackfifi
¿Puede compartir los datos sin procesar de la muestra también y el valor de la medida funcionando y no funcionando? ¿Dónde estás tratando de poner esta medida - No lo veo en las capturas de pantalla??

Sospecho que esto está relacionado con no tener el contexto de fila necesario para realizar el cálculo. ¿Qué es el DAX para Cantidad % Progreso Acumulativo ? ¿Qué es el DAX para % Complete_Qty? ¿Cuál es el nombre de la medida para la que proporcionó el DAX?

Lo siento por todas las preguntas, pero como sus datos son nuevos para mí, sólo necesito mucha información para entender lo que está tratando de hacer.

Esto ayudará a otros a ser capaces de responder también. 🙂

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Hola @AllisonKennedy

Las medidas utilizadas son para

1. % Complete_Qty á sum('Quantity'[Qty])/CALCULATE(sum('Quantity'[Qty]),all('_Calendar'))

2. % Complete_Qty_Cumulative ? CALCULATE(
[% Complete_Qty],
FILTRO(
ALLSELECTED('_Calendar'[Fecha]),
ISONORAFTER('_Calendar'[Date], MAX('_Calendar'[Date]), DESC)
)
))
Sobre la base del"% Complete_Qty_Cumulative", necesito contar el número de semanas y el número de meses en los que "% Complete_Qty_Cumulative" es entre el 10% y el 90%
En el siguiente caso, el RESULTADO para el recuento de MONTH debe ser de 7
MMM-AAPeríodo de qtyPeríodo de cantidad acumulativoProgreso de la cantidad %Progreso de cantidad % acumulativo
Jul-22331,855331,85512.76%12.76%
22 de agosto345,008676,86313.27%26.03%
Sep-22467,4221,144,28517.97%44.00%
Oct-22307,2731,451,55811.81%55.81%
Nov-22297,5171,749,07511.44%67.25%
Dic-22378,9582,128,03314.57%81.82%
Enero-23268,0272,396,06010.31%92.13%
Feb-23204,7192,600,7797.87%100.00%

Si desea contar meses, utilice VALUES(_Calendar[Month]) como tabla para el cálculo:

Numeros de números ( COUNTROWS(FILTER(VALUES(_Calendar[Month])), [% Complete_Qty]>-0.1 && [% Complete_Qty]<-0.9))

Si desea utilizar eso en la matriz anterior, es posible que deba agregar ALL() o el filtro ALLSELECTED allí también

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy - Perfecto! Eso funcionó... ¡Sólo tenía que usar"% Complete_Qty_Cumulative"! Cheers

Sí, por supuesto, lo siento por el error tipográfico pero me alegro de que lo descubrieras. 🙂

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.