Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi everyone,
I need help to create 4 measures, one measure to calculate the sum of sales based on the week,
For example,
I want one measure to calculate the sum of sales for the first week of the current month filtered, then another measure to calculate the sum of sales for the second week, another for the third, and a last one for the fourth week,
I need these measures to be flexible because my month column will be changing regularly,
For example, using my table above as a reference, I would like to get a measure showing a total of (28+58=86) for the first week, which is "18", when I'm seeing the Month "Mai", then a second measure showing a total of 27, because the second week is "19".
I've tried to use the formula "MIN", I've got for the first week, but for the week onwards, if I sum a "+1" at my "MIN" to get the second-week result for example, Power BI doesn't recognize my command.
Thank you for your help.
hi @Anonymous
try like:
measure1 =
VAR MinWeek = MINX(ALLSELECTED(data), data[Week])
RETURN
MINX(
FILTER(
data,
data[week]=MinWeek
),
data[Sales]
)
measure2 =
VAR MinWeek = MINX(ALLSELECTED(data), data[Week])
RETURN
MINX(
FILTER(
data,
data[week]=MinWeek+1
),
data[Sales]
)
...
Hi @FreemanZ ,
The "+1" into the MinWeek doesn't work here,
The first measure is working just fine,
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
19 | |
14 | |
10 | |
7 |