Forum Discussion
SL_1983
Helper II
6 years agodrilldown
Good morning, I have a question. I want to create 2 drilldwon tables: In the left table I want the following details: Product Omschrijving, Verpakking Omschrijving, Hoeveelheid. Then I want to ab...
- 6 years ago
I found the solution:
sumx('Ingrediënten';('Ingrediënten'[Verpakking Gewicht Duurste Prijs]* if (('Ingrediënten'[Hoeveelheid]/4)* SELECTEDVALUE('Slicer Aantal Personen'[Aantal Personen]) > 'Ingrediënten'[Verpakking Gewicht Duurste Prijs];( ROUNDUP (DIVIDE ((('Ingrediënten'[Hoeveelheid]/4)*SELECTEDVALUE('Slicer Aantal Personen'[Aantal Personen]));'Ingrediënten'[Verpakking Gewicht Duurste Prijs]);0));1)* RELATED ( 'Product'[Duurste Prijs] )))
SL_1983
Helper II
6 years agoHello,
no the input is using that measure is not correct.
I've created an excel sheeft based on Verpakking Hoogste Prijs. It includes the results that the meausure "Kostprijs Per aangekochte Verpakking Hoogste Prijs" should produce.
Link to the excel file: https://1drv.ms/x/s!AuaqHTxLCZ_h1jpRcr4IUX53wYDK?e=oocKku
SL_1983
Helper II
6 years agoHello MFelix ,
I've tried it using the below measure :
SUMX (
'Ingrediënten';
(
'Ingrediënten'[Verpakking Gewicht Goedkoopste Prijs]
* IF (
( 'Ingrediënten'[Hoeveelheid] / 4 )
* SELECTEDVALUE ( 'Slicer Aantal Personen'[Aantal Personen] ) <= 'Ingrediënten'[Verpakking Gewicht Goedkoopste Prijs];
1; if (
('Ingrediënten'[Hoeveelheid]/4)
* SELECTEDVALUE('Slicer Aantal Personen'[Aantal Personen]) > 'Ingrediënten'[Verpakking Gewicht Goedkoopste Prijs]; ROUND (
DIVIDE (
(('Ingrediënten'[Hoeveelheid]/4)*SELECTEDVALUE('Slicer Aantal Personen'[Aantal Personen]));
'Ingrediënten'[Verpakking Gewicht Goedkoopste Prijs]
);0)
* RELATED ( 'Product'[Goedkoopste Prijs] )
)
)
))
But the result is not correct.
The calculation for the number of packages should be as follows:
Example: slicer 1 pax:
if 'Ingrediënten'[hoeveelheid] <= 'Ingrediënten'[Verpakking Gewicht Duurste Prijs];1;(('Ingrediënten'[hoeveelheid]/4)/'Ingrediënten'[Verpakking Gewicht Duurste Prijs]).
If the result of the number of packages is 1.5, it should be rounded up to two.
Link to the excel sheet for the calculation: https://1drv.ms/x/s!AuaqHTxLCZ_h1jpRcr4IUX53wYDK?e=ygvAw6
Can someone assist me?
- SL_19836 years ago
Helper II
I found the solution:
sumx('Ingrediënten';('Ingrediënten'[Verpakking Gewicht Duurste Prijs]* if (('Ingrediënten'[Hoeveelheid]/4)* SELECTEDVALUE('Slicer Aantal Personen'[Aantal Personen]) > 'Ingrediënten'[Verpakking Gewicht Duurste Prijs];( ROUNDUP (DIVIDE ((('Ingrediënten'[Hoeveelheid]/4)*SELECTEDVALUE('Slicer Aantal Personen'[Aantal Personen]));'Ingrediënten'[Verpakking Gewicht Duurste Prijs]);0));1)* RELATED ( 'Product'[Duurste Prijs] )))