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 would like to create a card from my table called 'Debt' that provides the median debt per student [Id] per program [Program]. I have the used the following calcuation to do it per student, but I cannot figure out how to add the additional element of per program. We have several students at our institution who graduate from one program and enroll in another.
MEDIANX (
KEEPFILTERS(VALUES('Debt' [Id])).
CALCULATE(SUM('Debt' [Total])))
Thank you in advance for any insight.
Oh, you want only a card / one measure per both categories. Try this:
You have to create a virtual table with the sum values and than you can do the medianx
Measure =
Var __table = SUMMARIZE(Debt,Debt[ID],Debt[Programm],"__sum",sum(Debt[Total]))
RETURN MEDIANX(__table,[__sum])
Proud to be a Super User!
HI,
i try this with the raw data (left) and right the matrix with the median measure:
The median will calculated within the groups.
The measure:
Measure = MEDIANX(Debt,Debt[Total])
Proud to be a Super User!
Here is a example in the end of the article where two filters are used in keepfilters:
https://www.sqlbi.com/articles/using-keepfilters-in-dax/
Proud to be a Super User!
Thanks. That makes sense when trying to get calcuate the sum, but I still cannot figure out how to do it when I need the median of the sum for 2 filters/categories.