The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Buenos días,
Tengo el siguiente problema:
Tengo una base de datos de ordenadores con los operadores que utilizan dichos ordenadores. Cada ordenador puede ser utilizado por dos, uno o ninguno. En algunos casos una misma persona puede usar más de un ordenador. Adjunto algunos datos:
Operador1 Operador2 PC
Jose Perez Ana Fernandez PC-1
Alba Cuesta Jose Perez PC-2
Alba Cuesta PC-3
PC-4
Roberto Larcos PC-5
Javier Piri Ana Fernandez PC-6
Alba Cuesta Judit Becker PC7
Judit Becker PC8
El proceso que estoy intentando con esta tabla es: Unir las columnas "Operador1", "Operador2" y descartar los operadores duplicados. A partir de aquí, filtrar entre los operadores y los ordenadores para que, seleccionando cada operador, aparezcan los ordenadores que puede usar cada uno. De tal forma que aparezcan todos los ordenadores y, cuando selecciones un operador, aparezcan los ordenadores que utiliza este operador.
El problema llega cuando realizo el filtrado. Resulta que, al seleccionar los operadores que pertenece a la columna "Operador1" filtra bien los ordenadores y muestra los que puede usar. Pero, al seleccionar un operador que pertenece a la columna "Operador2", no filtra bien y aparece que tiene 0 ordenadores.
¿Cómo puedo conseguir unir las columnas "Operador1", "Operador2" y filtrar los ordenadores para que salgan los ordenadores que usa cada uno?
Saludos
Solved! Go to Solution.
Hi, @alejandroezp
Thanks for your sample data first.
According to your description, you want to filter the operator both in the two columns.
Here are the steps you can refer to :
(1)This is my test data:
(2)We need to click "New Table" to create a dimension table as the slicer visual field:
Table 2 = DISTINCT( FILTER( UNION( SELECTCOLUMNS('Table',"Operator" , [Operador1]) , SELECTCOLUMNS('Table',"Operator" , [Operador2])) , [Operator]<> BLANK()))
(3)Then we can create a measure like this:
Measure = var _operator1= MAX('Table'[Operador1])
var _operator2= MAX('Table'[Operador2])
var _slicer = VALUES('Table 2'[Operator])
return
IF(OR( _operator1 in _slicer , _operator2 in _slicer) ,1,0)
(4)Then we can put the measure on the "Filter on this visual" and we can get the result is as follows:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi, @alejandroezp
Thanks for your sample data first.
According to your description, you want to filter the operator both in the two columns.
Here are the steps you can refer to :
(1)This is my test data:
(2)We need to click "New Table" to create a dimension table as the slicer visual field:
Table 2 = DISTINCT( FILTER( UNION( SELECTCOLUMNS('Table',"Operator" , [Operador1]) , SELECTCOLUMNS('Table',"Operator" , [Operador2])) , [Operator]<> BLANK()))
(3)Then we can create a measure like this:
Measure = var _operator1= MAX('Table'[Operador1])
var _operator2= MAX('Table'[Operador2])
var _slicer = VALUES('Table 2'[Operator])
return
IF(OR( _operator1 in _slicer , _operator2 in _slicer) ,1,0)
(4)Then we can put the measure on the "Filter on this visual" and we can get the result is as follows:
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem. (You can also upload you sample .pbix [without sensitive data] to the OneDrive and share with the OneDrive link to me ! )
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
77 | |
72 | |
46 | |
39 |
User | Count |
---|---|
136 | |
108 | |
69 | |
64 | |
56 |