The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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)
User | Count |
---|---|
14 | |
12 | |
7 | |
6 | |
5 |
User | Count |
---|---|
28 | |
19 | |
13 | |
7 | |
5 |