Forum Discussion
INCORRECT TOTAL IN MATRIX
Hello good morning team,
How is it going?
I'm stuck with a measure, because I can't get the right total in my matrix.
I am trying to apply the same measure, but changing the level of hierarchy so that the total applies well to me, however I do not get the expected result.
In the end I needed to change the data at the source
otherwise it was impossible for me because I had to take into account many factors that were not well collected.
4 Replies
- amitchandakSuper User
afrutos , With help from columns in the visual group by, have new measure
Sumx(Summarize(Table, Table[NomEmpresa], Table[NombreCine], "_1", [MiniSTERIO_PRUEBA2]) , [_1])
and use that in visual
- afrutosResolver I
It is not working, let me explain the case:
In short, what I was looking for was that depending on my segmenter:
IN FAVOUR (DIF M-E<0)
AGAINST (DIF M-E<0)
NO DIFFERENCES (DIF M-E=0)
If I filtered through those lines whose difference is against us that I showed the months -->cines with their amounts for both the ministry column and the external column and their totalsAnd create that measure for each column in my matrix.
To create the segmenter,
Create an isolated table for me
And then for each column I applied that.MINISTERIO = CALCULATE(SUM(Consulta1[Importe]),Consulta1[ORIGEN]="MINISTERIO")EXTERNO = CALCULATE(SUM(Consulta1[Importe]),Consulta1[ORIGEN]="EXTERNO")DIFERENCIA M-E = [MINISTERIO]-[EXTERNO]In order to calculate the total I have done this function so that the segmenter picks me up. But when I go down in level, it doesn't workMINISTERIO FILTRO = var estado=SELECTEDVALUE(SEGMENTADOR[Columna2])returnSWITCH(true(),estado=1, SUMX(VALUES(Consulta1[IdEmpresa]), if([DIFERENCIA M-E]<0,[MINISTERIO],BLANK())),estado=2,SUMX(VALUES(Consulta1[IdEmpresa]), if([DIFERENCIA M-E]>0,[MINISTERIO],BLANK())),estado=3, SUMX(VALUES(Consulta1[IdEmpresa]), if([DIFERENCIA M-E]=0,[MINISTERIO],BLANK())), [MINISTERIO])Calculates well at the row level but does not correctly perform the column-level total
- PaulDBrownCommunity Champion
Try wrapping the IF statements in CALCULATE()
- afrutosResolver I
In the end I needed to change the data at the source
otherwise it was impossible for me because I had to take into account many factors that were not well collected.