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
enswitzer
Helper III
Helper III

Problema SelectedValue???

Estoy tratando de crear una matriz que muestre los ingresos por ubicación y proyecto .. Los proyectos individuales están funcionando muy bien, pero la suma total en la matriz para la ubicación no está sumando los números...

Mis fórmulas

Tabla: AllocatedProjectRevenue (tabla calculada, fórmula a continuación)

Entradas:

Importe: Ingresos para un proyecto

Porcentaje Incremental : % de los ingresos incrementales

Porcentaje de reemplazo: % de los ingresos de reemplazo

ID- ID de proyecto #

Ubicación : Ubicación de la producción

Tipo de ingresos: tabla con tres opciones para el tipo de ingresos (Incremental, Reemplazo, Total)

Fórmulas:

Incremental Revenue = if(selectedvalue(AllocatedProjectRevenue[Percent Total]) = 1, SUMX(AllocatedProjectRevenue, AllocatedProjectRevenue[Amount])*SELECTEDVALUE(AllocatedProjectRevenue[Percent Incremental ], 0), 0)

Ingresos de la reposición : if(selectedvalue(AllocatedProjectRevenue[Percent Total]) á 1, SUM(AllocatedProjectRevenue[Amount])*SELECTEDVALUE(AllocatedProjectRevenue[Percent Replacement ]), SUM(AllocatedProjectRevenue[Amount]))
quiere que asuma el 100% de los ingresos de reemplazo a menos que los ingresos incrementales + de reemplazo sean del 100 %; esta sección parece estar funcionando bien
Tipo de ingreso dinámico : if(selectedvalue('Select Revenue Type'[Revenue Type]) ? "Incremental", [Incremental Revenue], if(selectedvalue('Select Revenue Type'[Revenue Type]) ? "Replacement", [Repleacement Revenue], [Incremental Revenue]+[Repleacement Revenue]))
La salida debe tener un aspecto similar a esto (que es lo que estoy obteniendo para los ingresos de reemplazo)
2/20203/2020...6/20207/2020
Ubicación15022v 200200
-- Proyecto 15075 7575
-- Proyecto 2100100 22v22v
En su lugar, se ve algo como esto para los ingresos incrementales
2/20203/2020...6/20207/2020
Ubicación00 00
-- Proyecto 15075 7575
-- Proyecto 2100100 22v22v
No estoy seguro de si esto es relevante - pero aquí está la fórmula de tabla calculada @DataInsights arman para mí, y funciona GRAN (gracias!)
AllocatedProjectRevenue ( AllocatedProjectRevenue)
GENERAR (
'PP - Estado del proyecto: Ingresos',
VAR vProjectID á 'PP - Estado del proyecto: Ingresos'[IDid de proyecto]
VAR vProjectEndDate á 'PP - Estado del proyecto: Ingresos'[DP-F]
VAR vAllocationStartDateYear1 ?
EOMONTH ( vProjectEndDate, 1 )
VAR vAllocationEndDateYear1 ?
EOMONTH ( vAllocationStartDateYear1, 11 )
VAR vAllocationStartDateYear2 ?
EOMONTH ( vProjectEndDate, 13 )
VAR vAllocationEndDateYear2 ?
EOMONTH ( vAllocationStartDateYear1, 23 )
VAR vAllocationStartDateYear3 ?
EOMONTH ( vProjectEndDate, 25 )
VAR vAllocationEndDateYear3 ?
EOMONTH ( vAllocationStartDateYear1, 35 )
VAR vCalendar ?
CALENDARIO ( vAllocationStartDateYear1, vAllocationEndDateYear3 )
VAR vCalendarEOM ?
FILTRO ( vCalendar, [Fecha] - EOMONTH ( [Fecha], 0 ) )
VAR vRevenueYear1 á 'PP - Estado del proyecto: Ingresos'[Ingresos - Año 1]
VAR vRevenueYear2 á 'PP - Estado del proyecto: Ingresos'[Ingresos - Año 2]
VAR vRevenueYear3 á 'PP - Estado del proyecto: Ingresos'[Ingresos - Año 3]
VAR vResult ?
ADDCOLUMNS (
vCalendarEOM,
"Cantidad",
SWITCH (
VERDADERO (),
[Fecha] > á vAllocationStartDateYear1
&& [Fecha] <- vAllocationEndDateYear1, vRevenueYear1 / 12,
[Fecha] > á vAllocationStartDateYear2
&& [Fecha] <- vAllocationEndDateYear2, vRevenueYear2 / 12,
[Fecha] > á vAllocationStartDateYear3
&& [Fecha] <- vAllocationEndDateYear3, vRevenueYear3 / 12
)
)
devolución
Vresult
)

1 REPLY 1
AllisonKennedy
Super User
Super User

Es posible que deba probar MAX() o AVERAGE() en lugar del valor seleccionado. En el nivel de proyecto cuando se selecciona más de una ubicación, tiene demasiadas filas para mirar y no solo hay 1 valor seleccionado para el %.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.