Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi all,
I would appreciate your help with the following issue:
I'm trying to calculate how many conditions (2) per month are fulfilled by each customer. That is working fine.
But as you can see the sum is always the same (just 2x the amount of customers, 3653).
What I need is, that in the sum row it's only summing of the values from the corresponding colum (so for example: 2+0+0+1+2+1 ...........) and not what seems to happen now (2+2+2+2+2 .......)
What am I doing wrong?
Hi, @KenLucaaaaaa
in your code, SUMX is evaluating the sum of NPD1 and NPD2 for each D_Kunde thus resulting 2x numbers for all the customers.
you can modify the code as below,
NPD Bonus =
VAR NPD1_Ums = CALCULATE(
SUM(F_PosSalesPurchPriceGer[UmsatzAEP]),
DATESINPERIOD(D_Date[Tagesdatum], MAX(D_Date[Tagesdatum]), -7, DAY),
Filter(D_Products, D_Products[Pzn] in {16507534})
)
VAR NPD2_Ums = CALCULATE(
SUM(F_PosSalesPurchPriceGer[UmsatzAEP]),
DATESINPERIOD(D_Date[Tagesdatum], MAX(D_Date[Tagesdatum]), -7, DAY),
Filter(D_Products, D_Products[Pzn] in {16507540})
)
VAR TotalNPD =
SUMX(
D_Kunde,
IF(NPD1_Ums > 0, 1, 0) + IF(NPD2_Ums > 0, 1, 0)
)
RETURN TotalNPD
this should be helpful.
Proud to be a Super User!
User | Count |
---|---|
85 | |
80 | |
75 | |
49 | |
41 |
User | Count |
---|---|
114 | |
56 | |
51 | |
42 | |
42 |