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 moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
Hi, i need help with this visual
I have this matrix
Month | -3 | -2 | -1 | 0 | 1 | 2 | 3 | Total |
January | 2.3 | 2.2 | 2.5 | 1.2 | 2.7 | 2.6 | 2.9 | 6.9 |
February | 2.2 | 2.5 | 2.4 | 1.6 | 2.6 | 2.5 | 5.4 | |
March | 2.3 | 2.7 | 2.4 | 1.4 | 2.4 | 4.1 | ||
Total | 2.7 | 2.6 | 2.3 | 1.5 | 2.5 | 2.4 | 2.9 | 6.8 |
But i need to present it this way
Month | -3 | -2 | -1 | 0 | 1 | 2 | 3 | Total |
January | 2.3 | 2.2 | 2.5 | 1.2 | 2.7 | 2.6 | 2.9 | 6.9 |
February | 2.5 | 2.4 | 1.6 | 2.6 | 2.5 | 5.4 | ||
March | 2.4 | 1.4 | 2.4 | 4.1 | ||||
Total | 2.3 | 2.3 | 2.3 | 1.5 | 2.5 | 2.4 | 2.9 | 6.8 |
There are 2 dimensions, Months calendar and Harvest range (-3 to 3) wich is the periods before and after the month and 0 being the base month. And one measure, customer average transactions.
In order to evaluate the customer behaviour, the variation must be calculated using the same harvest range in each month. For example for February we must use the values (2.5, 2.4) vs (2.6, 2.5) wich is the range -2 to 2.
I am trying to do this, but with no luck
[Average Transaction] = DIVIDE(SUM(FACT_TRANSACTION_GROWTH[TRX]),DISTINCTCOUNT(FACT_TRANSACTION_GROWTH[CUSTOMER]))
MaxHarvest =
var Harvest = CALCULATE(MAX(HARVEST[MONTHS]), HARVEST[DAYS] = MAX(FACT_TRANSACTION_GROWTH[DAYS])) - 1
return IF(Harvest > 0, Harvest)
"I am substracting 1 because, the last month doesn't always have complete days."
Measure = IF(SELECTEDVALUE(HARVEST(MONTHS) >= MaxHarvest*-1 && SELECTEDVALUE(HARVEST(MONTHS) <= MaxHarvest,[Average Transaction] )))
This only result in this
Month | 0 |
January | 1.2 |
February | 1.6 |
March | 1.4 |
Total | 1.5 |
Solved! Go to Solution.
Solved it;
Solution:
1st - Create a measure to calculate the maximun month to harvest
Solved it;
Solution:
1st - Create a measure to calculate the maximun month to harvest
@Anonymous can you share the sample data with the expected output?
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
This is the fact Table
Month | Customer | Days | Amount |
January | A | 0 | 3 |
January | A | -13 | 6 |
January | A | -65 | 5 |
January | A | -84 | 5 |
January | A | -65 | 4 |
January | A | 58 | 2 |
January | B | 0 | 1 |
January | B | 49 | 5 |
January | B | -92 | 1 |
January | B | -78 | 3 |
January | B | -86 | 6 |
January | B | -56 | 3 |
January | C | 0 | 6 |
January | C | 15 | 6 |
January | C | -5 | 6 |
January | C | 68 | 3 |
January | C | -57 | 3 |
January | C | -96 | 5 |
And this is the dimension table
Days | Months |
-42 | -2 |
-41 | -2 |
-29 | -1 |
-28 | -1 |
-27 | -1 |
-26 | -1 |
-25 | -1 |
-24 | -1 |
-23 | -1 |
-22 | -1 |
0 | 0 |
1 | 1 |
2 | 1 |
3 | 1 |
4 | 1 |
5 | 1 |
6 | 1 |
7 | 1 |
8 | 1 |
9 | 1 |
10 | 1 |
11 | 1 |
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
User | Count |
---|---|
94 | |
90 | |
83 | |
76 | |
49 |
User | Count |
---|---|
145 | |
141 | |
109 | |
69 | |
55 |