Forum Discussion
Getting Totals From a Measure
This seems like it should be simple but I'm having issues with working with this measure.
I have two tables with a shared product key. One is an orders table with each row being an individual product purchased. The second table is cumulative forecast sales data with each row being a unique product. I have created a measure that simply calculates the difference between the forecasted number and the real sales number.
What I am trying to do is work with this measure to find totals (324), calculate the total oversold (426: excluding the instances where the measure is negative) and the total undersold (102: excluding the instances where the measure is positive).
Any ideas? Seems like it should be pretty straight forward but alas, here we are.
Hi awitt thanks for the detail desc
For you:
Because of the If condition, your measures didnt work. It takes a while to get used to and measures are almost always more efficient but in the meantime if you want to be sure you can start with cal columns.
Anywei i provided the solution both as a measure(M) and cal column (cal)regards
6 Replies
- YJResolver II
Can you provide the pbix file with the source tables
regards
- awittHelper III
- YJResolver II
Hi awitt thanks for the detail desc
For you:
Because of the If condition, your measures didnt work. It takes a while to get used to and measures are almost always more efficient but in the meantime if you want to be sure you can start with cal columns.
Anywei i provided the solution both as a measure(M) and cal column (cal)regards
- awittHelper III
Not entirely - the calculated columns gave me a circular reference error. The measures did work. I'm really looking for what to write in the flase part of the HASONEFILTER command.
I'll mark it as solved though for the measures.