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

Agregación de valores aleatorios

Hola

Espero que a todos les vaya bien.

Estoy generando dos números aleatorios de la siguiente manera:

Measure1 - var a - Calculate(Rand()*10) devuelve un

Medida2 - var b - Calcular(Rand()*20) retorno b

cada vez que trato de restar estos números, por ejemplo.

Medida3 - Medida1 - Medida2

O

Medida3 - var c -Calcular (Medida1 - Medida2) retorno c

No me da la respuesta correcta.

Por favor, ayuda

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Lionel_Maximus

Puesto que utiliza la función RAND, siempre genera un nuevo número en el cálculo en el momento. No almacena los valores y no es estático.
Hazme saber lo que estás tratando de lograr.

________________________

¿He respondido a tu pregunta? Marque este post como una solución, esto ayudará a otros!.

Haga clic en el icono Thumbs-Up a la derecha si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

7 REPLIES 7
AllisonKennedy
Super User
Super User

Tampoco estoy seguro de cuál es su objetivo final, pero puede resultar útil crear o insertar parámetros en Power BI Desktop mediante el botón integrado o GENERATESERIES DAX para crear segmentaciones de datos y qué pasaría si el análisis:
https://www.youtube.com/watch?v=a3Wn5s56mgo

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

Anonymous
Not applicable

Hola @AllisonKennedy ,

Sí, estoy tratando de hacer el análisis de lo que no sea, pero en valores aleatorios. No está produciendo los resultados correctos.

shli.PNG

Como puede ver el resultado (EBIT0) no es correcto.

Fórmula:

EBIT0 á [Vdp0_rand]-[Cons0_rand]-[Cserv0_rand]-[Clav0_rand]-[Gbt0_rand]-[Amm0_rand]

Vdp0_rand á RAND()*([Vdpmax0]-[Vdpmin0])+[Vdpmin0]
Vdpmax0 á (1+SELECTEDVALUE(maxVdp0[maxVdp0]))*SUM(Input[Vdp0])
Vdpmin0 á (1+SELECTEDVALUE(minVdp0[minVdp0]))*SUM(Input[Vdp0])
maxVdp0 - GENERATESERIES(-1, 1, 0.01)

Hola @Lionel_Maximus ,

Si tiene sentido, ¿puede aceptar las respuestas útiles como solución? Otros que tienen las mismas preguntas encontrarán respuestas es de manera essáz y rápida. Se beneficiarán de su hilo. 😉

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.

¿Puedes usar rebanadoras en lugar de Rand()?

Como @Fowmy mencionó, RAND es una función volátil y vuelve a calcular no siempre como cabría esperar.

Para ver si ese es el problema, intente agregar una medida de prueba como un valor a la matriz en su captura de pantalla:

RandCalcTest á [Vdp0_rand]


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

Pragati11
Super User
Super User

HI @Lionel_Maximus ,

¿Puedes compartir más detalles aquí por qué crees que esto está mal?

Gracias

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

amitchandak
Super User
Super User

@Lionel_Maximus, ¿cuál es el problema?

Fowmy
Super User
Super User

@Lionel_Maximus

Puesto que utiliza la función RAND, siempre genera un nuevo número en el cálculo en el momento. No almacena los valores y no es estático.
Hazme saber lo que estás tratando de lograr.

________________________

¿He respondido a tu pregunta? Marque este post como una solución, esto ayudará a otros!.

Haga clic en el icono Thumbs-Up a la derecha si le gusta esta respuesta 🙂

Youtube Linkedin

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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.