Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 98 | |
| 72 | |
| 50 | |
| 48 | |
| 42 |