Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have the following visual that shows the week by week shipping cost for a department. The [Cost per shipment] is a measure and I would like to take the median of this measure and bring it into the visual as well as a line chart. Is there a way to do this?
Week_Num is from a Calendar_Table
Table visual
WEEK_NUM | Cost per shipment | Median of Weekly Cost per Shipment |
1 | $7.41 | $9.05 |
2 | $9.47 | $9.05 |
3 | $7.83 | $9.05 |
4 | $9.05 | $9.05 |
5 | $9.21 | $9.05 |
6 | $7.91 | $9.05 |
7 | $10.19 | $9.05 |
8 | $8.57 | $9.05 |
9 | $8.13 | $9.05 |
10 | $9.27 | $9.05 |
11 | $9.90 | $9.05 |
12 | $6.67 | $9.05 |
13 | $9.99 | $9.05 |
Line Chart
Solved! Go to Solution.
Hi,
Median of Weekly Cost per Shipment = MEDIANX(VALUES(Calendar_Table[Week_Num]),[Cost per shipment])
Hope this helps.
Hi,
Median of Weekly Cost per Shipment = MEDIANX(VALUES(Calendar_Table[Week_Num]),[Cost per shipment])
Hope this helps.
You cannot measure a measure., Implement your entire business logic in the new measure, Use virtual table variables for the intermediate steps.
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Appreciate the response. So my issue here is that I have multiple measures that I have created using a bunch of tables. A lot of these measures are using sources from different tables, for instance cost per shipment uses overall cost from a finance database for actuals and shipments count of product from another table for outbound data.
The ask from execs is that for some of these measures, that are being tracked week over week, they'd like to see a target line in the charts that is based on the median of that measure, for the current period in the chart, usually 6 week rolling. Easy to do in excel but no idea how to go about it in power bi. I thought a simple table (the table above is not a screenshot, the chart is) could get my problem across.
You sample presents a static table. Measures behave differently, they are recalculated every time. That means your sample data in its current form is not covering your scenario.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
64 | |
60 | |
51 | |
36 | |
36 |
User | Count |
---|---|
81 | |
72 | |
58 | |
45 | |
44 |