Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
afrutos
Resolver I
Resolver I

Matrix

hello good morning,
I am managing a matrix that gives me some amounts per month and per cinema name, however the totals are not being taken correctly, I don't know what is the reason for this.

Does anyone know what is happening?

 

afrutos_0-1654075026916.png

thanks in advanced

1 ACCEPTED SOLUTION

In the end I managed to solve it on my own:
To correctly apply the segmenter I had to create myself a measure for each column, and at an origin I was not correctly applying sumx at the totals level,
The final measure was like this:

MINISTERIO FILTRO = var estado=SELECTEDVALUE(SEGMENTADOR[Columna2])
 
return
SWITCH(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])
 
Thanks anyway!

View solution in original post

7 REPLIES 7
vanessafvg
Community Champion
Community Champion

as an example for each measure try this

you need to iterate over month so that your total keeps the context of month.  Try this for each measure.

 

MINISTERIO =
CALCULATE (
    SUMX ( VALUES ( DATE[YEARMONTH] ), Consulta1[Importe] ),
    FILTER ( Consulta1, Consulta1[ORIGEN] = "MINISTERIO" )
)





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




vanessafvg
Community Champion
Community Champion

can you share your calculation?   Depending on how you have done your dax code for the calc it isn't always going to sum to the totals.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Hllo sorry,
I have all of them in a measure table

 

This is for column M:
MINISTERIO =
CALCULATE(SUM(Consulta1[Importe]),FILTER(Consulta1,Consulta1[ORIGEN]="MINISTERIO"))
This is for column E:
EXTERNO = CALCULATE(SUM(Consulta1[Importe]),FILTER(Consulta1,Consulta1[ORIGEN]="EXTERNO"))
This is the column for the difference:
DIFERENCIA M-E = Medidas[MINISTERIO]-Medidas[EXTERNO]
 
I would like for example to be able to filter by those in which the difference is a number >0 and to make the sum correctly.

without seeing your data it is hard to tell really but the reason it looks like this is happening to  me is because there is no filter context at the total level.

 

are you able to share some sample data for 2  months?





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




In the end I managed to solve it on my own:
To correctly apply the segmenter I had to create myself a measure for each column, and at an origin I was not correctly applying sumx at the totals level,
The final measure was like this:

MINISTERIO FILTRO = var estado=SELECTEDVALUE(SEGMENTADOR[Columna2])
 
return
SWITCH(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])
 
Thanks anyway!

well done sorry had a few busy days.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Okey tray with this if you can
https://easyupload.io/5ky6dt

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.