Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
My non-consecutive 3-month average is behaving like a consecutive 3-month average.
Context:
I have a measure [% Love it] calculating a percentage (see the bottom of this post for more info), and I'm using this measure in the following DAX to create a non-consecutive 3-month rolling average:
Where there are 2 months in a consecutive 3-month period, it is doing a 2-month average, and when only 1 month in that period, it just displays that single month's data point.
From what I have written, I can't see how it could be doing this. What have I done wrong?
Any help would be appreciated 🙂
More info:
[% Love it] is the percentage of people answering "Love it" at a question called A2p, calculated like so:
UNQUEID (just realised there's a typo... **bleep**, it's on every table!) is the ID associated with every respondent.
A2p is a table containing the UNQUEIDs and response to this question, unpivoted for each service ("Netflix, "Sky", etc). The above measure is filtered to just "Hayu" in the graph.
Sheet1 is a central demographics table, containing UNQUEIDs, gender, country, dates, etc.
Sheet1 and A2p are related via UNQUEIDs with a both-way many-to-one relationship (since A2p is unpivoted).
Solved! Go to Solution.
Hi @Loubot3000 I hope you have Date / calendar table. I suggest to create one if you do not have it.
Usually, dates reference should come from Date / calendar table not fact table
In part MAX(Sheet1[Month ID]) change to Date / Calendar table column and check results. Hope this help
Check link if can be usefull to you
Proud to be a Super User!
That worked, but I'm annoying that this worked 😂
I changed all the [Month ID]'s to [Period - month] which is indeed a date type.
I also changed 'ALL()' to 'ALLSELECTED()' so that it wouldn't include back in the missing months (since they are not missing in all contexts, only for specific countries).
However, when I tried that before, it wasn't working - it's only working now that I'm using the date type variable. I don't understand why. It should've worked.
Here's my code:
That worked, but I'm annoying that this worked 😂
I changed all the [Month ID]'s to [Period - month] which is indeed a date type.
I also changed 'ALL()' to 'ALLSELECTED()' so that it wouldn't include back in the missing months (since they are not missing in all contexts, only for specific countries).
However, when I tried that before, it wasn't working - it's only working now that I'm using the date type variable. I don't understand why. It should've worked.
Here's my code:
Hi @Loubot3000 I hope you have Date / calendar table. I suggest to create one if you do not have it.
Usually, dates reference should come from Date / calendar table not fact table
In part MAX(Sheet1[Month ID]) change to Date / Calendar table column and check results. Hope this help
Check link if can be usefull to you
Proud to be a Super User!
| User | Count |
|---|---|
| 57 | |
| 43 | |
| 32 | |
| 16 | |
| 13 |
| User | Count |
|---|---|
| 84 | |
| 70 | |
| 37 | |
| 27 | |
| 24 |