medianx
2 TopicsCalculating median of time by group
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. .pbix Here the data was imported, but im usind a direct query connection. Pd: In the pbix the Consulta1 is the same as tablaPortabilidades Thanks!Solved2.4KViews0likes5CommentsI'd like to find the median of the purchase price of the delivery in the weekly sales amount.
work MAXX( filter ('purchase data', VALUE('Purchase Data' [Product Number])=ValUE('Sales Data' [Product Number])&& 'Buy Data' [day]= ('Consolidated Purchase Week' [day])&& 'Purchased Data' [market]= 'Sales Data' [market]), 'Purchased Data' [Product Unit Price]) didn't work MEDIANX or AVERAGEX( filter ('purchase data', VALUE('Purchase Data' [Product Number])=ValUE('Sales Data' [Product Number])&& 'Buy Data' [day]= ('Consolidated Purchase Week' [day])&& 'Purchased Data' [market]= 'Sales Data' [market]), 'Purchased Data' [Product Unit Price]) data type sell (weekly) day(week) Product Number market sell data(weekly) 2021-1-3 45875 market1 4,500 2021-1-10 45875 market1 4,500 data type buy (weekly) day(weekly) Product Number market sell data(weekly) 2021-1-3 45875 market1 3600 2021-1-10 45875 market1 3600 In addition, I would like to obtain the median value by adding the data of the month corresponding to the week and the previous month. I wonder if this is possible and the solution. Please help me. Thank you for letting me know if there is a similar case. (I posted it on another board, but there was no answer, so I thought I was mistaken.)497Views0likes1Comment