Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. 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.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
87 | |
84 | |
66 | |
49 |
User | Count |
---|---|
127 | |
109 | |
93 | |
70 | |
67 |