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
Syndicate_Admin
Administrator
Administrator

Tabla de matriz

Hola a todos

Tengo una tabla de resumen que mostrará qué nivel de mis datos se basa en los ingresos (es decir, nivel 1) y una tabla de matriz a continuación para mostrar el incentivo. La tabla de incentivos debería estar tomando ingresos*prima% o ingresos*no premium%,dependiendo del nivel en el que esté ahora.

Por ejemplo, actualmente estoy en el nivel 1, por lo tanto, la primera fila de la tabla de incentivos debe ser 8 * 3% (prima), segunda fila debe ser 3.5 * 2% (no premium).

¿Alguien sabe cómo puedo lograrlo? Se ha adjuntado el enlace al ejemplo PBIX como referencia.

https://www.dropbox.com/s/di0gf37cgdwie4r/test1.pbix?dl=0

beekee_0-1620567823643.png

saludos

Bk

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

Allí @beekee,

He hecho todo lo posible con respecto a esto, las relaciones y los campos en él son demasiado complicados para mí. No conseguimos encontrar tu ubicación exacta. Lo siento mucho. Esperamos que las siguientes medidas le proporcionen inspiración.

ActlPlan_Rev_Final2 (format) =
VAR formatActl =
    IF (
        ISBLANK ( _Measures[ActlPlan_Rev_Range] ),
        "-",
        _Measures[ActlPlan_Rev_Range]
    )
VAR selectedWk =
    AVERAGE ( _ParaPeriod[Reporting Week (YYYYWW)] )
VAR selectedMth =
    SELECTEDVALUE ( _ParaPeriod[Fiscal Month Index] )
VAR week =
    IF (
        selectedWk >= _Measures[Min_WkInSelectedQtr (ActlPlan)]
            && selectedWk <= [Max_WkInSelectedQtr (ActlPlan)],
        formatActl,
        BLANK ()
    )
VAR month =
    IF (
        selectedMth >= _Measures[Min_MthInSelectedQtr (ActlPlan)]
            && selectedMth <= [Max_MthInSelectedQtr (ActlPlan)],
        formatActl,
        BLANK ()
    )
VAR category =
    SELECTEDVALUE ( _ParaPeriod[Category] )
VAR target =
    IF ( ISBLANK ( [Target] ) || [Target] = 0, "N.A.", [Target] )
VAR prem =
    FORMAT ( IF ( ISBLANK ( [Incentive_Prem %] ), 0, [Incentive_Prem %] ), "0.0%" )
VAR nonprem =
    FORMAT (
        IF ( ISBLANK ( [Incentive_NonPrem %] ), 0, [Incentive_NonPrem %] ),
        "0.0%"
    )
VAR testqqq =
    CALCULATE (
        IF (
            ISBLANK ( [Incentive_Prem %] ),
            [Incentive_Prem %] * 100,
            [Incentive_Prem %] * 100
        ),
        FILTER ( ALL ( 'Dim_Tier' ), Dim_Tier[Index] = 2 )
    )
VAR testrrr =
    CALCULATE (
        IF (
            ISBLANK ( [Incentive_NonPrem %] ),
            [Incentive_NonPrem %] * 100,
            [Incentive_NonPrem %] * 100
        ),
        FILTER ( 'Dim_Tier', Dim_Tier[Index] = 2 )
    )
VAR test1 =
    SWITCH (
        SELECTEDVALUE ( _Label[Label] ),
        "Target", target,
        "Premium", prem,
        "Non-Premium", nonprem,
        "Revenue", [Curr_PlannedRev_ActlPlan],
        "Achievement", [Curr_PlannedTierAch_ActlPlan]
    )
VAR test2 =
    IF (
        ISFILTERED ( _ParaPeriod[Para Period] ),
        SWITCH ( category, "Week", week, "Month", month, "Total", formatActl ),
        _Measures[ActlPlan_Rev_Range]
    )
VAR test33 =
    SWITCH (
        SELECTEDVALUE ( Fact_Actual[Sub-Cat] ),
        "Premium", test2 * testqqq,
        "Non-Premium", test2 * testrrr,
        TEST2
    )
VAR test34 =
    IF ( TEST2 <> "-", test33, "-" )
RETURN
    test34

v-luwang-msft_0-1620721062862.png

Saludos

Lucien

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.