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
Hello,
Sorry if i ask beginner questions. I hope someone can help me. Here is my dax measure formula :
Vert1 = CALCULATE(
VAR AA = SUMX('Lot 1','Lot 1'[Xp]-'Lot 1'[Prérequis])
VAR BB = IF (AA<0,0,1)
VAR CC = IF(BB>=2,2,BB)
RETURN CC
,Code[Color]="V")
I don't understand why I have values in my bar chart over 2 whereas i ask to put 2 if my variable goes over 2 . My bar chart is based on 2 other columns value. One column for C1 for competencies and the other C2 C2 is in absciss.
Thanks for your help
Hello @Anonymous
First of all, I also can't explain why this measure would ever return a number other than 0, 1 or 2.
It does look like you intended to write VAR CC slightly differently:
VAR CC = IF(AA>=2,2,BB)
Though that still doesn't explain why you are getting results > 2.
I would recommend something like this instead. It puts all the conditions in a single SWITCH function:
Vert1 =
CALCULATE (
VAR AA =
SUMX ( 'Lot 1', 'Lot 1'[Xp] - 'Lot 1'[Prérequis] )
RETURN
SWITCH ( TRUE (), AA < 0, 0, AA < 1, 1, 2 ),
Code[Color] = "V"
)
Does this give the expected result?
Regards
Owen
User | Count |
---|---|
12 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
19 | |
14 | |
8 | |
7 |