Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I have a sales listing.
Sales are grouped according to document number.
Each document number can have multiple sales lines.
VL Sales: All sales lines are of the VL type.
VR Sales: All sales lines are of the VR type.
Mixed Sales: There are sales lines that are VL and VR.
https://1drv.ms/u/s!AmRMGhswPKfD929RMuToyEAHE6x-?e=5retIu
The column "My Check" I have created manually and it is my goal, that by means of code that data is completed for each and every one of the sales lines.
"Check Solution 1" is the column created with the first solution you provided.
"Check solution 2" is a measure created with the second solution you provided.
My goal is to get a chart like the one below, in which I can get a summary of sales according to the "type line Sale" made. And that the unclassified 3284.28 come out correctly classified and add up to 3550.99 between VL, VR and VMixta.
Solved! Go to Solution.
Try this calculated column in Tabla:
Grouping =
VAR vCountVL =
CALCULATE (
COUNT ( Tabla[NumOp] ),
ALLEXCEPT ( Tabla, Tabla[NumOp] ),
Tabla[Type Line Sale] = "VL"
)
VAR vCountVR =
CALCULATE (
COUNT ( Tabla[NumOp] ),
ALLEXCEPT ( Tabla, Tabla[NumOp] ),
Tabla[Type Line Sale] = "VR"
)
VAR vCountAll =
CALCULATE ( COUNT ( Tabla[NumOp] ), ALLEXCEPT ( Tabla, Tabla[NumOp] ) )
VAR vResult =
SWITCH (
TRUE (),
vCountVL = vCountAll, "VL",
vCountVR = vCountAll, "VR",
"VMIXTA"
)
RETURN
vResult
Proud to be a Super User!
That is the solution. Thank you very much for your help. Greetings.
Try this calculated column in Tabla:
Grouping =
VAR vCountVL =
CALCULATE (
COUNT ( Tabla[NumOp] ),
ALLEXCEPT ( Tabla, Tabla[NumOp] ),
Tabla[Type Line Sale] = "VL"
)
VAR vCountVR =
CALCULATE (
COUNT ( Tabla[NumOp] ),
ALLEXCEPT ( Tabla, Tabla[NumOp] ),
Tabla[Type Line Sale] = "VR"
)
VAR vCountAll =
CALCULATE ( COUNT ( Tabla[NumOp] ), ALLEXCEPT ( Tabla, Tabla[NumOp] ) )
VAR vResult =
SWITCH (
TRUE (),
vCountVL = vCountAll, "VL",
vCountVR = vCountAll, "VR",
"VMIXTA"
)
RETURN
vResult
Proud to be a Super User!
User | Count |
---|---|
128 | |
109 | |
100 | |
65 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |