Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Visual dinámico basado en más de 1 valor seleccionado

Hola a todos

Estoy tratando de obtener medidas dinámicas para trabajar donde los usuarios pueden elegir 1 opción de la tabla "Valor de visualización" y 1 opción de la tabla "Intervalo de fechas".

Por ejemplo:

Si se selecciona "Por TCE" y "YTD", se mostrará el precio yTD TCE
Si se selecciona "Por TCE" y "Último mes", se mostrará el precio del mes pasado

Si se selecciona "Importe total" y "YTD", se mostrarán los ingresos de YTD

etcetera

He creado mis 2 tablas:

Table 1.PNGTable 2.PNG

Puedo conseguir que funcione si sólo hay una mesa, pero con la 2a mesa lo está haciendo difícil.

Dynamic YTD or Month - Price = 
    IF(
        SELECTEDVALUE('Date Range Option'[Date Range]) = "YTD",
        ([YTD TCE Price]),
        ([Last Month TCE Price])
)

Idealmente otra línea que diga "if(valor seleccionado " "TCE") Then "

Intenté hacer una columna calculada IF Statement uniendo las dos tablas juntas, pero termina mostrando en blanco.

Dynamic IF Statement = 
IF('Aggregation Option'[Display Value] = "YTD",
IF('Aggregation Option'[Display Value] = "Per TCE",
[YTD TCE Price],
IF('Aggregation Option'[Display Value] = "Last Month",
IF('Aggregation Option'[Display Value] = "Per TCE",
[Last Month TCE Price],
1
))))

¡Cualquier ayuda sería genial!

Gracias

1 ACCEPTED SOLUTION
Anonymous
Not applicable

logró que funcionara usando el siguiente código:

Dynamic Options = 
    IF(
        AND(
            SELECTEDVALUE('Date Range Option'[Date Range])= "Last Month",
            SELECTEDVALUE('Aggregation Option'[Display Value]) = "Per TCE"
        ),
        [Last Month TCE Price],

    IF(
        AND(
            SELECTEDVALUE('Date Range Option'[Date Range])= "Last Month",
            SELECTEDVALUE('Aggregation Option'[Display Value]) = "Total Amount"
        ),
        [Last Month Revenue NZD],
        
    IF(
        AND(
            SELECTEDVALUE('Date Range Option'[Date Range])= "YTD",
            SELECTEDVALUE('Aggregation Option'[Display Value]) = "Total Amount"
        ),
        [YTD Sales NZD],
        
    IF(
        AND(
            SELECTEDVALUE('Date Range Option'[Date Range])= "YTD",
            SELECTEDVALUE('Aggregation Option'[Display Value]) = "Per TCE"
        ),
        [YTD TCE Price],
        0
    )
)))

View solution in original post

6 REPLIES 6
VijayP
Super User
Super User

Usar SWITCH Funciton

•SWITH(TRUE(),
SELECTEDVALUE(
AND([valor de visualización]-"Por TCE", [Intervalo de fechas]-"YTD"), [YTD TCE PRICE) ,
AND([valor de visualización]-"Por TCE", [Intervalo de fechas]-"último mes"), [Precio de la ECT del último mes), [Precio de la ECT del último mes), [Precio de la ECT del último mes), [Precio de la ECT del último mes), [Precio de la ECT del último mes), [Precio de la ECT del último mes), [Precio de la ECT

1))

Esto le ayudará




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Anonymous
Not applicable

@VijayP Gracias por su respuesta!

He intentado la fórmula siguiente, aunque estoy recibiendo un error.

SWITCH(TRUE(),
SELECTEDVALUE(
AND('Opción de agregación'[Mostrar valor] ?"Por TCE", 'Opción de agregación'[Mostrar valor] - "YTD"), [Precio YTD TCE],
AND('Opción de agregación'[Mostrar valor] á"Por TCE", 'Opción de agregación'[Mostrar valor] á "último mes"), [Precio de TCE del último mes],

1))
error.PNG
He usado una columna calcualada. ¿Es esto correcto?
Gracias

Anonymous
Not applicable

@VijayP Otra pregunta, en columna calculada, ¿por qué no puedo elegir la tabla de intervalo de fechas en mi fórmula, como sugeriste? ¿Es porque no tengo ninguna relación entre los dos?

Anonymous
Not applicable

logró que funcionara usando el siguiente código:

Dynamic Options = 
    IF(
        AND(
            SELECTEDVALUE('Date Range Option'[Date Range])= "Last Month",
            SELECTEDVALUE('Aggregation Option'[Display Value]) = "Per TCE"
        ),
        [Last Month TCE Price],

    IF(
        AND(
            SELECTEDVALUE('Date Range Option'[Date Range])= "Last Month",
            SELECTEDVALUE('Aggregation Option'[Display Value]) = "Total Amount"
        ),
        [Last Month Revenue NZD],
        
    IF(
        AND(
            SELECTEDVALUE('Date Range Option'[Date Range])= "YTD",
            SELECTEDVALUE('Aggregation Option'[Display Value]) = "Total Amount"
        ),
        [YTD Sales NZD],
        
    IF(
        AND(
            SELECTEDVALUE('Date Range Option'[Date Range])= "YTD",
            SELECTEDVALUE('Aggregation Option'[Display Value]) = "Per TCE"
        ),
        [YTD TCE Price],
        0
    )
)))
Icey
Community Support
Community Support

Hola @TheBlacklist ,

Me alegra saber que este problema ha sido resuelto. Usted puede ayudar a aceptar la solución anterior. Su contribución es muy apreciada.

Saludos

Icey

@TheBlacklist Espero que mi idea haya funcionado y si lo crees, por favor selecciona mi respuesta como solución y comparte tus Kudos.

También puedes ver mis Vidoes en www.youtube.com/perepavijay y visitar mi Perfil de LinkedIne

saludos

Vijay Perepa




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors