Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I need a method for calculaing the median of multiple (3) columns. I tried using MEIDIANX but realized it was taking blanks and zeros into account and providing incorrect results. I then tried to add a FILTER to the argument but got an error saying "Expressions that yield variant data-type cannot be used to define calculated columns." so I'm at a loss now. I'm unable to supply the data as it's incredibly large and contains sensitive elements. This is what I had written:
New Column=
MEDIANX(
FILTER(
'tableA',{'tableA[column1],'tableA',{'tableA[column2],'tableA',{'tableA[column3]} <> BLANK() ),
{'tableA[column1],'tableA',{'tableA[column2],'tableA',{'tableA[column3]})
I also tried lots of other combinations of including or not including the table names, using a VALUE expression, none of which produced accurate results and most of which produced syntax errors. I'm sure this is incredibly simple but I'm at a loss. I'm still very new to DAX and getting more frustrated every day. I appreciate any and all help.
Thanks.
Hi, I have got same issue regarding MEDIANX did you get any solution for that , can you share with me how can I achieve it.....Thank you !
@DJBAJG Probably should unpivot, but if you don't want to do that, https://community.powerbi.com/t5/Quick-Measures-Gallery/Multi-Column-Aggregations-MC-Aggregations/m-...
Also, make sure to read this to avoid pain and suffering!! https://community.powerbi.com/t5/Quick-Measures-Gallery/To-bleep-With-MEDIAN/m-p/1322755#M599
I don't think this works. Here's a screenshot of my output and the measure. The dark blue bar in the graph should represent the median of all of the values in the chart, ignoring blanks. 17 non-blank values, order, take the middle. That would give us $2,500. I tried a few different ways but I'm actually unable to get $1,225. What am I missing? Does this not work when filtered?
You can see I'm using 5 columns. Did it do the measure incorrectly when creating the tmpTable?
Just figured it out. Because it's using MEDIANX it's taking the blanks into account and treating them as zeros. This doesn't work for me. Any way around this in your example of do we need a different solution?
Come on community. I've a newbie here and this is probably incredibly simple.
Please! Still need help here. I'm spinning my wheels getting nowhere on my own. 😞
Here's the answer. Like I assumed, incredibly simple for probaly 99% of the people on this forum but tough for me. Wish someone would have chimed in. Could have saved my a day....
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
84 | |
76 | |
73 | |
42 | |
36 |
User | Count |
---|---|
109 | |
56 | |
52 | |
48 | |
43 |