Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi.
Im having trouble in calculating the median of a column in my proyect. I can't get it to work (no result).
Well, the thing it's like this.
I have 2 tables, one it's a calendar table and the other one it's my data table. They have a one to many relation.
I want to get the median of a column, group by date (month date) like i have my other measures, but i cant get it to work.
The values that i want to get the median, are expresed in seconds.
So, what i want should be something like this:
And it should be able to filter by Consulta1[CANAL]
I tried creating a measure in many ways,
median (time_total) = MEDIAN(tablaPortabilidades[TPO_TOTAL])
median (time_total) = MEDIANX(tablaPortabilidades, tablaPortabilidades[TPO_ACEPT])
I also tried creating a measure that sums [TPO_ACEPT] and then creating a median of this sum, but same result.
The result:
Can someone give me a hand?
I don't know how to upload my .pbix here so i upload it to my drive.
Here the data was imported, but im usind a direct query connection.
Pd: In the pbix the Consulta1 is the same as tablaPortabilidades
Thanks!
Solved! Go to Solution.
Hi,
Are you creating it as a measure? If so your dax is ok and seems to work with the demo you sent:
Here the measure has just been dropped into the values box of the matrix.
The only thing I can think is you might be trying to create a calculated column? If so MEDIAN isn't supported over direct query MEDIAN function (DAX) - DAX | Microsoft Docs
Hi,
Are you creating it as a measure? If so your dax is ok and seems to work with the demo you sent:
Here the measure has just been dropped into the values box of the matrix.
The only thing I can think is you might be trying to create a calculated column? If so MEDIAN isn't supported over direct query MEDIAN function (DAX) - DAX | Microsoft Docs
I supposed it was something related with direct query. Is there a way to something like this with direct query? I can't import the whole data set because it's huge.
I tried doing it on sql but then i can't filter it.
Yes, it actually works but only if a import the data. My issue is that i have to work with direct query, yes or yes. So, im looking for a way of doing the same but with direct q.
Can you expand the error details on the visual and send it over?
I've just setup an example using direct query to contoso in SQL and can make a MEDIAN measure work so wondering if there is another issue.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
43 | |
20 | |
18 | |
16 | |
15 |
User | Count |
---|---|
49 | |
26 | |
22 | |
17 | |
16 |