Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
chinthada
Helper I
Helper I

Measure with Median value for each quarter

Hello,

 

I want to display a measure with a Median value for each quarter (fiscal quarter). I created a dynamic calendar and linked it with the Data table. Data is like the below table. I need to display a visual chart with the median value of "fiscal year 2019 Q1"=XX, "fiscal year 2020 Q3"=xx etc.

daa.PNG

thanks

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @chinthada ,

 

Please try the measure below.

Measure = CALCULATE(MEDIAN('Table'[value]),ALLEXCEPT('Table','Table'[fiscal year],'Table'[fiscal qtr]))

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

7 REPLIES 7
v-jayw-msft
Community Support
Community Support

Hi @chinthada ,

 

Please try the measure below.

Measure = CALCULATE(MEDIAN('Table'[value]),ALLEXCEPT('Table','Table'[fiscal year],'Table'[fiscal qtr]))

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Hello @v-jayw-msft ,

 

You made my day :). Thanks, it is working well.

 

regards,

 

Greg_Deckler
Super User
Super User

Tough to be exact as I don't believe I have all of the information I need. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

That being said, I am guessing something like:

Median = 
  VAR __Median = MEDIANX(RELATEDTABLE('Sales'),[Sales])
  VAR __Date = MAX([Date])
  VAR __Year = YEAR(__Date)
  VAR __Quarter = QUARTER(__Date)
RETURN
  "fiscal year " & __Year " & "Q" & __Quarter & "=" & __Median

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Tad17
Solution Sage
Solution Sage

Hey @chinthada 

 

Check out this link as I think it answers your exact problem: https://community.powerbi.com/t5/Desktop/Calculate-Quarterly-Average-of-measure/td-p/252829

 

If this helps please kudo. 

If this solves your problem please accept it as a solution.

Hi @Tad17 & @Greg_Deckler ,

 

Thanks for the reply. I think I should create a calculated column with the median value for each quarter. Can you help on that?

 

thanks

 

Sure, kind of depends though. The formula provided was kind of intended for a column. Kind of depends on the relationship between the tables. You have a date table and then a sales table that has what kind of data in it? Dates? Quarters? Years? Months?

 

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler 

Thanks for the reply. What I need to show is like below,

median for each quarter.PNG

I have a source table like this,

source table.PNG

To create the Quarterly median graph as above, I am thinking to create a calculated column (Median) like below,

 

target table.PNG

 

What would you suggest?

 

thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.