The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello Power Query (M) and Power BI Gurus!
I'm trying to use 3 Lists within Power BI Desktop as my Parameters to create tables using the AdobeAnalytics Connector (API) (See Below for the generated Power Query Code). The AdobeAnalytics Connector only allows for the use of Segments stacked on top of each other (For those that are not familiar with AdobeAnalytics think of a segment as a filter). So my only option (that I see thus far) is to iterate through all possible combinations of the 3 lists to generate all of the calls (i.e. trying to a Nested Loop that creates all of these tables for me and then combines them to one table).
Data Components:
3 Lists of values to use as my Nested Parameters for each call
Programs (1 Column)
Regions (1 Column)
MarketingChannels (1 Column)
Power BI Desktop - Power Query AdobeAnalytics API connection
1. Create a table for every combination of the Values within the 3 Lists e.g.:
2. Once all of the tables have been created I need to combine them
The below code snippet would be an example of Table 1,
(note the line that starts with "{Cube.ApplyParameter, "Segment","as that is where the Lists above would be used as parameters)
let Source = AdobeAnalytics.Cubes(), invitrogenprod = Source{[Id="invitrogenprod"]}[Data], #"Added Items" = Cube.Transform(invitrogenprod, { {Cube.ApplyParameter, "DateRange", {#date(2018, 3, 21), #date(2018, 3, 21)}}, {Cube.ApplyParameter, "Segment", {{"#Programs[A]", "#Regions[A1]", "#MarketingChannels[A11]"}}}, {Cube.AddAndExpandDimensionColumn, "DateGranularity", {"year", "month", "day"}, {"Date Granularity.Level 1: Year", "Date Granularity.Level 2: Month", "Date Granularity.Level 3: Day"}}, {Cube.AddMeasureColumn, "Engaged Visits", "cm300001617_5a84e003de3c977de97c39d2"}, {Cube.AddMeasureColumn, "Engaged Visits (PDP)", "cm300001617_5a58160e8f0c657d68a6e404"}, {Cube.AddMeasureColumn, "Visits w/ Cart Activity", "cm300001617_5a50160c4ecbca5712928ab6"} }) in #"Added Items"
Any and all help will be greatly appreciated!!!
Solved! Go to Solution.
@Anonymous,
How about creating a single parameter that listing all the possible combination values, then using this single paramater in your M script?
Regards,
Lydia
@Anonymous,
A method I can think of is to create parameters(e.g, program parameter,regions parameter and marketing parameter) that contained the following values in Power BI Desktop, then use these parameters into your Power Query code.
(#Programs[A], #Regions[A1], #MarketingChannels[A11])
(#Programs[A], #Regions[A1], #MarketingChannels[B22])
There is a blog for your reference:
http://biinsight.com/power-bi-desktop-query-parameters-part-1/
Regards,
Lydia
@Anonymous,
Do you list all possible values when creating parameters? If you have, you are able to choose values from drop-down list.
Regards,
Lydia
@Anonymous,
How about creating a single parameter that listing all the possible combination values, then using this single paramater in your M script?
Regards,
Lydia
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.