Forum Discussion
jorgus
7 years agoFrequent Visitor
Sales vs Sales Target
Hello everyone. I have a group of sales tables, related to each other, and I have a table of sales objectives, which is not related to any table but has keys from several tables. These are the s...
jdbuchanan71
7 years agoSuper User
Hello jorgus
Try these two measures.
The first one is just to sum the target
SumOfImporte = SUM ( Dim_Objetivo[Importe] )
This next one takes the target and applies the filtering from the values selected for the other columns
Budget Amount =
VAR YearList =
VALUES ( Dim_Calendario[Año] )
VAR SucursalList =
VALUES ( Dim_Sucursal[IdSucursal] )
VAR RubroList =
VALUES ( Dim_Producto[IdRubro] )
VAR LineaList =
VALUES ( Dim_Producto[IdLinea] )
VAR GrupoList =
VALUES ( Dim_Producto[IdGrupo] )
RETURN
CALCULATE (
[SumOfImporte],
TREATAS ( YearList, Dim_Objetivo[Año] ),
TREATAS ( SucursalList, Dim_Objetivo[IdSucursal] ),
TREATAS ( RubroList, Dim_Objetivo[IdRubro] ),
TREATAS ( LineaList, Dim_Objetivo[IdLinea] ),
TREATAS ( GrupoList, Dim_Objetivo[IdGrupo] )
)
jorgus
7 years agoFrequent Visitor
Good morning jdbuchanan71 , thanks for you answer.
With the function treadas it works perfectly, it was what I needed.
The problem I still have is when in my budget table a column has no value, for example IdGrupo, when a value is missing, the measure returns nothing since it expects the value of the GroupID.
- jdbuchanan717 years agoSuper User
If the column has not value on a row how would PowerBI know which lines to assign it to? That is how it is supossed to behave.