Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Ich möchte gerne nach einer bestimmten ProduktID suchen können, die beim ersten Kauf "Rang Bestellungen" = 1 hat und sehen, welche Produkte dann bei der Bestellung Rang 2 gekauft wurden. Also, Kunden, die beim ersten Kauf Produkt XXX gekauft haben, haben beim 2. Kauf welche Produkte gekauft?
Solved! Go to Solution.
Hi @Broeselchen ,
You can update the formula of calculated column [2. Kauf] as below and check if that is what you want... Please find the details in the attachement.
2. Kauf =
IF (
'Table'[Belegart] = "RE",
CONCATENATEX (
FILTER (
'Table',
'Table'[KundenID] = EARLIER ( 'Table'[KundenID] )
&& 'Table'[Rang Bestllungen]
= EARLIER ( 'Table'[Rang Bestllungen] ) + 1
&& 'Table'[Belegart] = "RE"
),
'Table'[ProduktID],
"; ",
'Table'[ProduktID]
),
BLANK ()
)
Best Regards
@Broeselchen , A new column
Rank = rankx(filter(Table, [KundenID] = earlier( [KundenID] )), [BestellDatum],,asc,dense)
This is what I´ve got already. I need the products of the second order and the possibility to filter for a product from the first order.
My question: What buyed the customers in the second order, when they buyed the product x in the first order?
Sorry, if my english is not the best 😉
@Broeselchen , if you need product in last order
maxx(filter(Table, [KundenID] = earlier( [KundenID] ) && [Rank] = earlier( [Rank] ) -1 ), [Product Id])
Hope this can help
Yes, I did it in a column, right? But it's not completely what I need, because it could be that there are a few products in the last order. Maybe it's not possible?
Hi @Broeselchen ,
What's your final expected result? Are you trying to get a product that was purchased when Rank was equal to both 1 and 2? If yes, You can create a calculated column as below to get it, please find the details in the attachment. Otherwise, could you please give a practical example of the result you want. Thank you.
Column =
VAR _1rankproduct =
CALCULATE (
MAX ( 'Table'[ProduktID] ),
FILTER (
'Table',
'Table'[KundenID] = EARLIER ( 'Table'[KundenID] )
&& 'Table'[Rang Bestllungen] = 1
)
)
VAR _2rankproduct =
CALCULATE (
MAX ( 'Table'[ProduktID] ),
FILTER (
'Table',
'Table'[KundenID] = EARLIER ( 'Table'[KundenID] )
&& 'Table'[Rang Bestllungen] = 2
&& 'Table'[ProduktID] = _1rankproduct
)
)
RETURN
IF ( ISBLANK ( _2rankproduct ), BLANK (), _1rankproduct )
Best Regards
Thist is what I want to get:
But I can't imagine, how it could looks like, because the result needs more than one column or row....
Hi @Broeselchen ,
I updated the sample pbix file(see attachment), please check if that is what you want.
1. Create a measure as below to judge if the product should display
Flag =
VAR _2rankproducts =
CALCULATETABLE (
VALUES ( 'Table'[ProduktID] ),
FILTER (
'Table',
'Table'[KundenID] = SELECTEDVALUE ( 'Table'[KundenID] )
&& 'Table'[Rang Bestllungen] = 2
)
)
RETURN
IF (SELECTEDVALUE( 'Table'[ProduktID]) in _2rankproducts,1,0)
2. Apply the filter on the visual with the condition (Flag is 1)
Best Regards
Nein, leider nicht das, was ich möchte. Ich versuche es mal als Frage zu formulieren. Welche Produkte kaufen Kunden in ihrem 2. Kauf, wenn sie im ersten Kauf Produkt XXX gekauft haben?
Hi @Broeselchen ,
You can create a calculated column as below:
2. Kauf =
CONCATENATEX (
FILTER (
'Table',
'Table'[KundenID] = EARLIER ( 'Table'[KundenID] )
&& 'Table'[Rang Bestllungen]
= EARLIER ( 'Table'[Rang Bestllungen] ) + 1
),
'Table'[ProduktID],
"; "
)
Best Regards
Fast! Ich dachte, ich könnte die Belegart im Visual rausfiltern, aber das geht nicht. Im Datensatz habe ich Bestellungen, Rechnungen und Gutschriften sortiert nach Belegart. Jede Belegart enthält die ProductIDs. Ich möchte aber nur die Produkte der Rechnung. Jetzt erscheint aber jede ProductID mehrfach. Es muss noch ein Filter Belegart RE in die Formel.
Hi @Broeselchen ,
You can update the formula of calculated column [2. Kauf] as below and check if that is what you want... Please find the details in the attachement.
2. Kauf =
IF (
'Table'[Belegart] = "RE",
CONCATENATEX (
FILTER (
'Table',
'Table'[KundenID] = EARLIER ( 'Table'[KundenID] )
&& 'Table'[Rang Bestllungen]
= EARLIER ( 'Table'[Rang Bestllungen] ) + 1
&& 'Table'[Belegart] = "RE"
),
'Table'[ProduktID],
"; ",
'Table'[ProduktID]
),
BLANK ()
)
Best Regards
Ja! Vielen, vielen Dank!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
75 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |