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

Cálculo del promedio ponderado del período anterior

Tengo un filtro de nivel de página para que los usuarios seleccionen una fecha (31 de diciembre de 2020), la página muestra una medida promedio ponderada (tasa de límite en las valoraciones de propiedades.

Ahora quiero mostrar la tasa de capitalización promedio ponderada para el período anterior también (30 de junio de 2020), sin embargo, mi ponderación se suma (es decir, aparece como 1) y no se muestra por propiedad:

DB_ClientOnlyFV_PY = 
//Provides the total portfolio fair value of only the client (i.e. excludes the market) for one period prior to the latest period
VAR currFVdate = // Determines the latest date which is assumed to be the most recent date of the valuation
    CALCULATE (
        MAX ( 'Client'[Date] ),
        FILTER ( ALL ( Client ), 'Client'[Adopted Value] > 0 )
    )
VAR priorDate = //Determines the date just before the max date
    CALCULATE(
        MAX(Client[Date]),
        FILTER(All (client),'Client'[Adopted Value] > 0 && 'Client'[Date]<currFVdate) //Filter to show the date just prior to the MAX date
    )
RETURN 
CALCULATE(
    SUM(Client[AdoptedValueFIX]),
    FILTER(
        ALL(Client),
    Client[Date]=priorDate 
    && Client[Client Name] <> "Market" //Show all properties where the property is NOT a market property
    )

)

Al probar la fórmula hasta la variable priorDate, la fecha devuelta es correcta, sin embargo, la sección de devolución final contiene un error y la ponderación devuelta es 1 para todas las propiedades de la base de datos.

¿Alguna idea? Sospecho que esto es un problema con mi filtro?

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

@mjoost , Esto no parece una fórmula de promedio ponderado. Esto es suma con filtro.

Cuando trabaja con fecha y desea moverse a través de la tabla de fechas de uso unida a su fecha

Prueba como con la tabla de fechas

DB_ClientOnlyFV_PY = 
//Provides the total portfolio fair value of only the client (i.e. excludes the market) for one period prior to the latest period
VAR currFVdate = // Determines the latest date which is assumed to be the most recent date of the valuation
    CALCULATE (
        MAX ( 'Client'[Date] ),
        FILTER ( ALL ( Client ), 'Client'[Adopted Value] > 0 )
    )
VAR priorDate = //Determines the date just before the max date
    CALCULATE(
        MAX(Client[Date]),
        FILTER(client,'Client'[Adopted Value] > 0), Filter(all(Date) , 'Date'[Date]<currFVdate) //Filter to show the date just prior to the MAX date
    )
RETURN 
CALCULATE(
    SUM(Client[AdoptedValueFIX]),
    FILTER(
        (Client),
     Client[Client Name] <> "Market" //Show all properties where the property is NOT a market property
    ), filter(all('Date'),     'Date'[Date]=priorDate )


)

Gracias @amitchandak ,

Lo anterior es parte del cálculo (es decir, para obtener el valor por propiedad). Tengo un cálculo separado para determinar el peso (siendo el resultado de la fórmula anterior) buceado por el valor razonable total en toda la base de datos.


El problema al que me enfrento : el resultado de esta fórmula devuelve el total de la cartera, o dicho de otra manera, si tuviera que crear una tabla, aparece de la siguiente manera, en lugar de mostrar el valor de la propiedad correspondiente para el período anterior en la tabla.

image.png

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.