Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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....
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
72 | |
62 | |
51 | |
48 |
User | Count |
---|---|
204 | |
86 | |
62 | |
59 | |
56 |