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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Combinación RuleName

Rule Combination.PNG

5 REPLIES 5
nandukrishnavs
Super User
Super User

@Choosenbuy

Tienes que añadir una columna"Grupo"para identificar el grupo.

Consulte el siguiente ejemplo.

Tabla de muestras.

RuleNameTotal de registrosTotal Record PassedGrupo
A100501
B2001501
C230752
D502302
E150503
F751503

Tabla calculada

Table 2 =
CALCULATETABLE (
    SUMMARIZE (
        'TestData',
        TestData[Group],
        "Rule Name", CONCATENATEX (
            DISTINCT ( TestData[RuleName] ),
            TestData[RuleName],
            ","
        ),
        "Total Record", SUM ( TestData[Total Records] ),
        "Total Record Passed", SUM ( TestData[Total Record Passed] )
    )
)

Capture.JPG



¿Respondí a tu pregunta? ¡Marca mi puesto como solución!
Apreciar con un kudos
🙂


Regards,
Nandu Krishna

Anonymous
Not applicable

cualquier sugerencia como una consulta SQL

Hola @Choosenbuy ,

Para SQL Query, puede intentar escribirlo de la siguiente manera:

select case when RuleName in ('A','B') then 'AB' when RuleName in ('C','D','E') then 'CDE' when RuleName in ('F','G') then 'FG' end as RuleName,
sum([Total Records])"Total Records", sum([Total Records Passed]) "Total Records Passed",sum([Total Records Failed]) "Total Records Failed",
cast(cast(100 *(sum([Total Records Passed])/sum([Total Records])  )as decimal(18,1) ) as varchar(50))+'%' "Pass%",
cast(cast(100 *(sum([Total Records Failed])/sum([Total Records])  )as decimal(18,1) ) as varchar(50))+'%' "Fail%"
from Rules
group by 
case when RuleName in ('A','B') then 'AB' when RuleName in ('C','D','E') then 'CDE' when RuleName in ('F','G') then 'FG' end

sql.PNG

Saludos

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@Choosenbuy

Si está funcionando, márquelo como una solución.


Regards,
Nandu Krishna

Anonymous
Not applicable

Gracias. permítanme probar la solución

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.