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
Majidbhatti
Advocate IV
Advocate IV

HASONEVALUE añadiendo fila BLANK

Estoy tratando de arreglar TOTALES de una Matriz, pero terminando con la adición de una fila BLANK como se muestra en la imagen de abajo

Screenshot 2020-12-24 201154.png

Mi medida es como abajo, tengo valores para reemplazar 2, 3, 4, y 5, pero mantenerlo simple aquí. ¿Puede ayudar por favor

Budget MTD = 
 If( HASONEVALUE(M_Hierarchy[L1]) ,
        SWITCH( SELECTEDVALUE ( M_Hierarchy[L1] ),
            "Rooms",
                2,
                3
        )
, 
        SWITCH( SELECTEDVALUE ( M_Hierarchy[L1] ),
            "Rooms",
                4,
                5
        )
)

1 ACCEPTED SOLUTION

Corrección del problema. Hubo un problema en las relaciones entre las tablas

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Majidbhatti , Pruebe una medida como

Presupuesto MTD á sumx(values(M_Hierarchy[revenue]), // Use la tabla correcta
If( HASONEVALUE(M_Hierarchy[L1]) ,
SWITCH( SELECTEDVALUE ( M_Hierarchy[L1] ),
"Habitaciones",
2,
3
)
,
SWITCH( SELECTEDVALUE ( M_Hierarchy[L1] ),
"Habitaciones",
4,
5
)
))

@mahoneypat , me gustaría que fuera tan fácil, pero BLANK no se muestra en el filtro visual

@amitchandak , Todos los elementos son SUMAXed que está soplando los totales.

Vea el problema a continuación

Screenshot 2020-12-26 204230.png

Budget MTD (Rev) = 
Var vMonthDays = DATEDIFF( STARTOFMONTH(DateTable[Date]) , ENDOFMONTH(DateTable[Date])+1 , DAY )
Var vVal = CALCULATE(
                TOTALMTD([Actual Amount (AX)], DateTable[Date],AX_Data[Type] = "B") ,
                M_Hierarchy[L1Code] <> "9"
            ) 

Return

If( HASONEVALUE(M_Hierarchy[L1]) ,
    SWITCH( SELECTEDVALUE ( M_Hierarchy[L1] ),
        "Rooms",
            vVal,
        (vVal / vMonthDays ) * SELECTEDVALUE(DateTable[DAY])
        )
        ,
          //THIS SECTION IS THE PROBLEM  
          CALCULATE(
                TOTALMTD([Actual Amount (AX)], DateTable[Date],AX_Data[Type] = "B") ,
                M_Hierarchy[L1Code] <> "9"
            )
)

Corrección del problema. Hubo un problema en las relaciones entre las tablas

mahoneypat
Employee
Employee

En el panel Filtro, resalte ese objeto visual y desactive la casilla En blanco de la columna Ingresos. También puede hacerlo con DAX con AND o un IF anidado, pero eso es más fácil.

saludos

palmadita





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.