Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I need to calculate three sums and one division in a single step (Measure) to create the array shown in the image.
Each month is also calculated (Precio = Costos / Consumos)
Solved! Go to Solution.
Thanks for the exmaple picture!
Try this
Create some test data
Create a DAX measure
Answer =
var myvariable = SELECTEDVALUE(yourdata[Variable])
var x = CALCULATE(SUM(yourdata[Value]), yourdata[Variable] = "Costos")
var y = CALCULATE(SUM(yourdata[Value]), yourdata[Variable] = "Consumos")
RETURN
IF(myvariable = "Precio",
DIVIDE(x , y),
SUM(yourdata[Value])
)
Draw your matrix
Please click at least thumbs up for me trying to help.
Then click [accept solution] if it works.
Or provide a better description with input data as table (not a picture)
and example output.
You will get a quick and better answer with no misunderstandings if you provide clear examples
Muchas gracias desde México.
The arrays with the months are no problem. I'll take care of it. Thank you very much.
I am glad my solution solved your problem.
Please click the thumbs-up and [accept solution] button.
Thank you !
Thanks for the exmaple picture!
Try this
Create some test data
Create a DAX measure
Answer =
var myvariable = SELECTEDVALUE(yourdata[Variable])
var x = CALCULATE(SUM(yourdata[Value]), yourdata[Variable] = "Costos")
var y = CALCULATE(SUM(yourdata[Value]), yourdata[Variable] = "Consumos")
RETURN
IF(myvariable = "Precio",
DIVIDE(x , y),
SUM(yourdata[Value])
)
Draw your matrix
Please click at least thumbs up for me trying to help.
Then click [accept solution] if it works.
Or provide a better description with input data as table (not a picture)
and example output.
You will get a quick and better answer with no misunderstandings if you provide clear examples
Muchas gracias desde México.
The arrays with the months are no problem. I'll take care of it. Thank you very much.
Hi @telesforo1969,
Could ypu please provide the data how it's looking in Power BI and what type of visual are you going to used.
Thank you. It's a matrix, and I solved it with the proposed "speedramps" code.