cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MISgirlNY
Frequent Visitor

DAX function

Hello, I'm relatively new to Power BI. Need help with median and standard deviation DAX functions (MEDIAN and

STDEV.P)

Both accept only reference to a column. I need to use MEASURE which is monthly TOTALs . Need to show on line chart monthly totals over a period of 2 years along with Median and Stand. deviation. Your help is much appreciated!!!

1 ACCEPTED SOLUTION

Accepted Solutions
MISgirlNY
Frequent Visitor

Re: DAX function

Thank you so much for your response. Not sure how to apply your formulla   to my case. I've created a measure:

Total Inpatient Orders = CALCULATE(COUNTROWS(distinct(OPIOIDS[IDcode])), FILTER (OPIOIDS,OPIOIDS[IsGiven] = 1))

I got a perfect monthly linechart for a few years that shows montly Total Inpatient Orders. Now need to apply MEDIAN and Standard Deviation to this chart. Any suggestions?

Thanks again

View solution in original post

5 REPLIES 5
JasonTX Resolver I
Resolver I

Re: DAX function

If understand correctly, you want to find Standard deviation and median grouped by monthly totals. You may want to create a Summarize or Summarize Column.

 

It should look something like:

 

STDEVX.P(
  SUMMARIZE(
       [Table],
       'Table'[Date].[Month],
        "Total", Sum([Sales])
        ),
   [Total]
)

 

Please let me know if this works. 

 

Regards

MISgirlNY
Frequent Visitor

Re: DAX function

Thank you so much for your response. Not sure how to apply your formulla   to my case. I've created a measure:

Total Inpatient Orders = CALCULATE(COUNTROWS(distinct(OPIOIDS[IDcode])), FILTER (OPIOIDS,OPIOIDS[IsGiven] = 1))

I got a perfect monthly linechart for a few years that shows montly Total Inpatient Orders. Now need to apply MEDIAN and Standard Deviation to this chart. Any suggestions?

Thanks again

View solution in original post

JasonTX Resolver I
Resolver I

Re: DAX function

Replace SUM(Sales) with [Total Inpatient Orders] and 'Table'[Date] with whatever date column you are using.

 

Hope that helps 😁

MISgirlNY
Frequent Visitor

Re: DAX function

Thank you so much. I was able to create a stand. dev. measure. But when I try to place it into Values on my chart, I see the 'hour glass' sign for long, and never finishes. Like Cortesian product in Transact SQL. Any idea?

Thank you

MISgirlNY
Frequent Visitor

Re: DAX function

Never mind. I;ve found the issue. My mistake. Thank you

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors