Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi All
I need to calculate the median price for the year 2022 Q2. I have the following measure which doesn't work
thank you
UPDATE:
I have changed my date, Instead of auto date which I was using before I now use Calendar Table. And the output I am getting is different, but still not correct. In my report I need to see number $440 not $435. What is wrong here?
Solved! Go to Solution.
HI @xariet,
Perhaps you can try to add them into the filter function to calculate with current filter effects:
Med Price for Q2 2022 =
CALCULATE (
MEDIAN ( 'output for power BI'[Price] ),
FILTER (
ALLSELECTED ( 'output for power BI' ),
YEAR ( [Date] ) = 2022
&& QUARTER ( [Date] ) = 2
)
)
If the above also don't help, please share some dummy data and more detailed information to help us clarify your scenario and test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
HI @xariet,
Perhaps you can try to add them into the filter function to calculate with current filter effects:
Med Price for Q2 2022 =
CALCULATE (
MEDIAN ( 'output for power BI'[Price] ),
FILTER (
ALLSELECTED ( 'output for power BI' ),
YEAR ( [Date] ) = 2022
&& QUARTER ( [Date] ) = 2
)
)
If the above also don't help, please share some dummy data and more detailed information to help us clarify your scenario and test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
thank you @Anonymous , your solution worked!
This might be a typo issue. Check that the last part of that formula is changed from:
QUARTER('output for power BI'[Date]= 2))
to
QUARTER('output for power BI'[Date])= 2)
(basically just change the brackets a bit)