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.
Can someone help me create a measure that generates the WeeklyRate column below?
The calculation is [Loss] divided by the sum of [StartQtySx] for the week.
ID | Start of Week | StartQtySx | Loss | WeeklyRate |
5312521 | 6/5/2022 | 56008 | 5185 | 1.24% |
5312522 | 6/5/2022 | 55840 | 7389 | 1.76% |
5312523 | 6/5/2022 | 54632 | 16613 | 3.96% |
5312524 | 6/5/2022 | 41760 | 7082 | 1.69% |
5312525 | 6/5/2022 | 31728 | 1946 | 0.46% |
5312526 | 6/5/2022 | 49872 | 2892 | 0.69% |
5312527 | 6/5/2022 | 55737 | 6628 | 1.58% |
5312528 | 6/5/2022 | 38128 | 4223 | 1.01% |
5312707 | 6/5/2022 | 35496 | 4677 | 1.12% |
5312609 | 5/29/2022 | 42351 | 5540 | 1.82% |
5312621 | 5/29/2022 | 33513 | 4632 | 1.52% |
5312634 | 5/29/2022 | 55532 | 6760 | 2.22% |
5312647 | 5/29/2022 | 52314 | 5728 | 1.88% |
5312660 | 5/29/2022 | 33341 | 3872 | 1.27% |
5312673 | 5/29/2022 | 37539 | 2737 | 0.90% |
5312686 | 5/29/2022 | 49814 | 4128 | 1.36% |
I'm using this measure but it's giving me different numbers
Solved! Go to Solution.
Are you creating a measure or column.. you should create a measure
m_WeeklyRate =
VAR Numerator = SUM('Table'[Loss])
Var Denominator = CALCULATE ( SUM([StartQtySx]),ALLEXCEPT ( 'Table', 'Table'[Start of Week] ))
RETURN
Numerator/Denominator
Proud to be a Super User!
The results seems correct to me.
Can you please explain what results you are expecting as
5185/419201 returns = 1.24% for the first value and vice versa for the all week
similarly for the previous week 5540/304404 returns = 1.82% and vice versa for the all week
Proud to be a Super User!
This is what PBI desktop is giving me.
Notice the WeeklyRate is incorrect.
m_WeeklyRate =
VAR Numerator = SUM('Table'[Loss])
Var Denominator = CALCULATE ( SUM([StartQtySx]),ALLEXCEPT ( 'Table', 'Table'[Start of Week] ))
RETURN
Numerator/Denominator
Proud to be a Super User!
Are you creating a measure or column.. you should create a measure
m_WeeklyRate =
VAR Numerator = SUM('Table'[Loss])
Var Denominator = CALCULATE ( SUM([StartQtySx]),ALLEXCEPT ( 'Table', 'Table'[Start of Week] ))
RETURN
Numerator/Denominator
Proud to be a Super User!
It's a column.
I tried it with a measure instead but getting the same incorrect values.
[Edit]
Nevermind, I needed to filter the dataset. The measure and column both work after this.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
80 | |
74 | |
66 |
User | Count |
---|---|
129 | |
106 | |
106 | |
86 | |
72 |