﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / SQL Server 2005 / Business Intelligence  / SSAS Median Function / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 19:32:00 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: SSAS Median Function</title><link>http://www.sqlservercentral.com/Forums/Topic912926-147-1.aspx</link><description>Hello Ken.If your intention is to query a cube then Mdx is your query-language. MDX has a built-in Median function you can use. The following (MDX) query results in the medium value for the internet sales count-measure based on the cutomer education.[code="sql"]with member [measures].[median internet sales count] as MEDIAN( [Dim Customer].[Education].[Education].members ,[Measures].[Internet Sales Count]  )select {[measures].[median internet sales count]} on 0from [Adventure Works DW][/code]The outcome of this query is:median internet sales count10603By querying the measure Internet Sales Count by Customer Education we can validate that the median has been caluculated correctly.[code="sql"]select {[Measures].[Internet Sales Count]} on 0,order([Dim Customer].[Education].[Education].members, [Measures].[Internet Sales Count], asc) on 1from [Adventure Works DW][/code]which results in:[code="sql"]	Internet Sales CountPartial High School	4,708High School	10,320Graduate Degree	10,603Partial College	16,623Bachelors	18,144[/code]QEDHope this helps you out.Cees  </description><pubDate>Sun, 02 May 2010 16:45:08 GMT</pubDate><dc:creator>cees van diermen</dc:creator></item><item><title>SSAS Median Function</title><link>http://www.sqlservercentral.com/Forums/Topic912926-147-1.aspx</link><description>This is going to sound pretty bad but I have never used a function in SSAS  to date.  I have always been able to work around it and now I have a need to figure the Median of a value but don't know where to even start.  Online help was nothing but confusing telling me to create an mdx query, I have to believe it's much easier then that.  Can someone out there do a bit of hand holding while I get this function to work against an existing measure within the cube.</description><pubDate>Thu, 29 Apr 2010 08:40:14 GMT</pubDate><dc:creator>ken-467489</dc:creator></item></channel></rss>