cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not applicable

Contar meses distintos de años distintos

Hola mundo

¿Podría ayudarme?

Soy nuevo en Power BI y no encontré la respuesta a mi pregunta en Internet

Necesito calcular una cantidad de meses en mi hoja.

Por ejemplo, en 2019 tengo cinco meses (agosto, sep, octubre, noviembre y diciembre), y en 2020 tengo más de cinco meses (enero, febrero, marzo, abril, mayo) - Total de 10 meses. Cuando hago "distinctcount(Months)" el sistema cuenta 12 meses, pero no tengo Jun y Jul en mi hoja. Quiero saber por qué sucede eso.

Y en agosto de 2020, no sé cómo contar un nuevo mes.

¿Podrías ayudarme con estas dos preguntas?

Agradecido

7 REPLIES 7
v-xuding-msft
Community Support
Community Support

Hola @GuiManfredo ,

Usted podría probar esto en primer lugar:

Count Months = CALCULATE(DISTINCTCOUNT('Table'[Month]),ALLEXCEPT('Table','Table'[Year]))

2.PNG

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

En primer lugar, tnks tanto para su ayuda

por desgracia, esta fórmula me sigue devolviendo 12 meses, no 10

Si desea echar un vistazo a mi base de datos, el enlace está a continuación

https://drive.google.com/drive/folders/1G1vJfbr-Nd-ZrkTm736q3Vy8G2oJeu9U?usp=sharing

@GuiManfredo

tal vez usted puede tratar de agregar una columna de mes

mes-mes(tabla[fecha])

A continuación, distinctcount(month)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ryan_mayu
Super User
Super User

@GuiManfredo

Comparta los datos de muestra y la salida esperada.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Hola Ryan,

Siga el enlace de Bellow de la hoja

https://drive.google.com/drive/folders/1G1vJfbr-Nd-ZrkTm736q3Vy8G2oJeu9U?usp=sharing

Necesito que el recuento de los meses devuelva 10

la forma en que lo estoy haciendo es devolver 12, y en mi base de datos no hay meses junio y julio

GuiManfredo_0-1593609845132.png

hasta ahora estoy usando la misma fórmula que en el comentario a continuación:

Count Months = CALCULATE(DISTINCTCOUNT('Abonos'[Date].[ Month]),ALLEXCEPT('Abonos',Abonos[Date].[ Month]))

No tengo una hoja de DCalendar, así que no tiene sentido hacer una fórmula usando otra hoja

Tnks para su ayuda

Puede agregar una columna calculada a la tabla con esta fórmula

YearMonth - FORMAT(Table[Fecha], "YYYMMM")

y luego hacer una medida que hace un DISTINCTCOUNT de esa columna.

Si esto funciona para usted, márquelo como la solución. Los elogios también son apreciados. Por favor, avísame si no.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


nvprasad
Solution Sage
Solution Sage

Hola

Creo que está aplicando un recuento distinto en la columna que tienen 10 meses en lugar de tabla de calendario (si tiene alguna).

¡Aprecia un Kudos! 🙂
Si esto ayuda y resuelve el problema, por favor márquelo como una solución! 🙂

saludos
N V Durga Prasad

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors