Power Query and multi-selection columns

I have a power query pulling data from a sharepoint list some of the list columns allow multiple selections.
The power query seems to only be pulling in one value instead of all the selected ones in the columns.
Thanks,
Eric

Hi Eric,
Just to add a bit more detail to what is going.
In Power Query, SharePoint List columns with multiple selection choices are represented as nested tables with a single column called "Value". Each row of these nested tables will represent a selected choice for the list item. You can examine this by clicking
on "Table" under the "Options" column on one of the rows.
By clicking on the "Expand" icon of a column, you are making use of the Table.ExpandTableColumn function. That function will take each row in the table and do a cross product with the rows of the nested tables of the selected column. This means that each
row will be duplicated as many times as there rows in the nested columns.
In this specific case, each item in the SharePoint list will become duplicated as many times as there are selected choices for the item. This can be very useful in some cases, but I think that in your case this is not the operation that you're looking for.
If you want to simply create a column that combines all the selected choices as a single text value, there's a simpler alternative to Alejandro's solution:
= Table.AddColumn(RemovedColumns, "Options 2", each Text.Combine([Options][Value], ", "))
You can simply paste the above as a blank step by clicking on the "Fx" icon next to the formula bar. Here we're creating a new column called "Options 2" that combines the text values in the "Value" column of the nested table of the Options column and separate
each entry by ", ".
-Tristan

Similar Messages

  • Make Record for folder and multi-selected files

    Hi,
    'Make Record' item disappeared in MENU for folders not for files.
    And it can't make record for multi-selected files.
    I can only make Record by one and one.
    How to make Records for folder and multi-selected files?
    Regards
    Kitae

    Programatically, only a single document at a time can be made a record :-
    makeRecord
    public Item makeRecord(long parentId,
    long docId,
    NamedValue[] attrs,
    AttributeRequest[] attributes)
    throws FdkException
    You could potentially through a custom workflow triggered on UserRequest allow multiple submitted documents to be made records through a custom BPEL process calling Content DB Web Services.
    Matt.

  • Query on Multi-select Item and STRING_TO_TABLE

    Hi everyone - here's the scoop:
    I've got a multi-select item on a US state field that returns one or more state ID selected (eg. '15:26:49'). I want to use that to find rows in a table where the state ID is one of those values. State ID is indexed and I want to ensure that the index can be used, so I don't want to be doing "where instr(...)".
    I read a post on Ask Tom - http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:110612348061 - where he parses a string of values into a table that can be used in an IN clause, thus allowing use of the index.
    Here's my question - I'd like to take advantage of APEX_UTIL.STRING_TO_TABLE to do my parsing, but it returns APEX_APPLICATION_GLOBAL.VC_ARR2. I tried a bunch of different casts but couldn't make it work with a query done as per Tom Kyte's post. Ultimately I wrapped STRING_TO_TABLE and just "copy" the VC_ARR2 to a table of numbers, like this:
    create or replace function string_to_numtbl(p_string in varchar2, p_separator in varchar2 default ':')
    return num_table as
    l_data num_table := num_table();
    l_vc_arr2 APEX_APPLICATION_GLOBAL.VC_ARR2;
    begin
    l_vc_arr2 := APEX_UTIL.STRING_TO_TABLE(p_string, p_separator);
    FOR z IN 1..l_vc_arr2.count LOOP
    l_data.extend;
    l_data(l_data.count) := l_vc_arr2(z);
    END LOOP;
    return l_data;
    end;
    So I can use the multi-select to feed an IN clause. I'm still getting familiar with casts, but it seems to me thought that there ought to be a straighter path to allow the return of APEX_UTIL.STRING_TO_TABLE to be used in an IN.
    Any thoughts?

    VC_ARR2 is an index by table and in the Tom's example he is using a nested table which
    has a different structure and allows different operations. To make this short, you will not be
    able to use VC_ARR2 in a SQL statement. Yes, it would be good since ApEx has its own
    function to convert a string to a table and back. I have no problems using Tom's examle.
    Here, you will find some description on differences:
    http://www.unix.org.ua/orelly/oracle/prog2/ch19_09.htm
    and here, you may want to se the utilization of PL/SQL collections on my demo application:
    http://htmldb.oracle.com/pls/otn/f?p=31517:84
    http://htmldb.oracle.com/pls/otn/f?p=31517:87
    Denes Kubicek

  • Combo Prompt Design (with Drop down and Multi-select prompts)

    Hi folks,
    I have the following prompt design requirement in OBIEE dashboard:
    PromptA: should be a drop-down prompt
    PromptB: should be a multi-select prompt
    PromptB should list the values contained in either of two dimensions (lets say: Product Names and Product Group Names ). Lets define Product Names to be the names of individual products, while the Product Group Names is the names of a predefined collection of certain products.
    The string values that should appear in the PromptA then are: Product Names and Product Group Names. Consequent to the selection made in PromptA, values from one of these two dimensions should be dynamically displayed in PromptB. That is, if Product Names is selected from PromptA, then all product names from the Product Names dimension should be listed in PromptB. And if Product Group Names is selected from PromptA, then all product group names from the Product Group Names dimension should be listed in PromptB.
    Can anyone tell me how do I relate the above two prompts and have my reports to work accordingly?
    regards,
    Mahendra
    Edited by: Mahendra Varman on Jan 7, 2009 12:11 PM
    Edited by: Mahendra Varman on Jan 7, 2009 12:21 PM

    Hi
    For this you have to do two dashboard prompt
    In promptA:
    select one dummy column,
    In control dropdown list select dropdown
    In show dropdown list select SQL Results
    In sql results write the following query
    Select case when 1=0 then tabelname.column else 'Tablename.ProductNames' end from subjectarea name
    Union all
    Select case when 1=0 then tablename.column else 'Tablename.ProductGroupName' end from subject are name
    In set variable ->set presentation variable called var1
    Saved it as PromptA
    In PromptB:
    Select one dummy column in that column forumla write @{var1}
    but problem with this approach it shows two Go buttons for two prompts to avoide this create custom Go button
    for creating custom Go button see this link
    http://obiee101.blogspot.com/2008/11/obiee-how-to-replace-multiple-go-button.html
    Try this its not work let me know
    i tried for another solution
    Regards
    Naresh

  • OnSubmit and Multi-Select

    Hi all -
    I am going a little nuts here. I am trying to get the page to submit when a user click on an entry in the multi-select list. I was able to do so with onclick="javascript:doSubmit('LIST1')" in the element properties.
    I have an on-submit procedure which updates a collection when the request = LIST1. This works perfectly. I also have a Before Header procedure which creates/truncates the collection. Its supposed to just empty the collection on the first page view - I have the condition set to fire every time except when the request is LIST1.
    So after debugging, I found the request variable is not being carried through after submitting, and the before header process is truncating the collection. So I guess my curiosity got the better of me, and I'm wondering how the buttons work b/c when I mouse over them they say javascript:doSubmit('SOMETHING'). Any ideas on what I need to do different to get the request in the URL like the buttons?

    When your page is submitted with a certain value for REQUEST (either when you click a button or explicitly call doSubmit(<request> as you did), the value of REQUEST is available only for the duration of "accept processing" i.e. all the processing in the Page Processing column of your Page Definition.
    As the last step in accept processing, branches are evaluated and the first branch whose condition evaluates to true is taken and the flow engine redirects to the page specified by the branch. The value of REQUEST will be blank for this (new) show request.
    If you would like your REQUEST value to carry through to the subsequent page show, you can define a branch to conditionally fire when REQUEST=LIST1 and in that branch's definition, again pass in REQUEST=LIST1. Now this value of REQUEST will be visible to your Before Header process on the subsequent show request.
    Hope this helps.

  • Prompts and Multi-Select Picklists

    Hi all,
    I'm trying to find a neat way of prompting and doing a "contains any" filter a report i have on a multi select picklist within accounts.
    e.g. Field can have values A, B, C
    Account 1: A
    Account 2: A, B
    Account 3: B, C
    Account 4: A, C
    Account 5: A, B
    I wanted a report to give me anything with A or C in it... should bring back 1,3,4,5
    I used a dashboard prompt as i like the look of the Multi-Select box used. The problem used was that when i first ran it the options I was given were:
    A
    A,B
    B,C
    A,C
    Basically listing the different combinations possible... but i just want the list to say A, B,C. So i tried to put this SQL query on the values:
    +'SELECT "- Custom MSP_1 (Account)".MSPICK_01 FROM "Account Analysis" WHERE "- Custom MSP_1 (Account)".MSPICK_01 NOT LIKE '%,%' '+
    The problem is that it (correctly) only bring back the values that occur on their own... so only "A"!
    Any way for me have it pull back just the values defined in the picklist under app customisation?
    Feel like i rambled on but hopefully it makes sense!
    Thanks,
    Alex

    I can see what you are trying to get at, but I wonder if it will work.
    Even if you somehow get A,B,C as individual values in the prompt then how is it going to filter the report.
    Lets say on the dashboard prompt you select B then as per your example your report should show Account 2,3,5.
    But it wont because the field that you have used in your report doesn't contain B as a standalone. The values that it contain say A,B or B,C is one string or one entity.
    So the multi-select prompt based on that field is going to show the values contained in that field which is what you are initially getting.
    You will have to do something in the report itself to break it down so that you get A,B,C as single entity.
    I have a vague idea but I wonder if it works. You can still try though :)
    Assuming your report is a single criteria report, pull any field and edit its Fx as follows:
    CASE WHEN - Custom MSP_1 (Account)".MSPICK_01 LIKE '%A%' THEN 'A' WHEN - Custom MSP_1 (Account)".MSPICK_01 LIKE '%B%' THEN 'B' WHEN ... ELSE NULL END
    Assuming here that you only have values like A,B,C.
    So what I am hoping is that the custom field that we created will have values like A,B,C as separate entities and in the table view for your example we will have 9 rows.
    Account MSPICK Custom Field
    Acc 1 A A
    Acc 2 A,B A
    Acc 2 A,B B
    Acc 3 B,C B
    Acc 3 B,C C
    and so on
    Finally in your prompt design, take any field and modify its Fx like the CASE WHEN condition described above and that should give you A,B,C as you want it.
    Also you may hide the custom field in your final report.

  • Assessment Scripts and Multi Select Picklists

    Hi
    Is it possible for a question within an assessment script to have more than one answer and therefore update a Multi-Select picklist?
    We have a script that would be ideal for an assessment script but there are a number of questions within the script that would require multiple answers - any help or suggestions appreciated
    Cheers

    The assessment functionality only allows one answer per question to be stored in the Lead, Contact, Opportunity or Service Request object.

  • Pagination using table growing property and multi-select table issues

    Hi,
    We're using the growing property on a table, thus the pagination is handled by the control it self.
    However, if we want to update some item in the table, in order to get those details reflected, we're refreshing the model, which is performance intensive.
    Is there any way we can update the UI only without creating any UI inconsistencies?
    Another question is that, is there any way to disbale the checkbox on the table items, based on some property from the backend. we tried to use editable property, but it hides the entire row.
    We need to disable the checkbox on the rows for particular items?
    Also, I need to know any resources on the mobile library where I can find the CSS related documentaion.
    Like we need to create a icon + text structure, which controls should be ideal to use? I have used
    <HBox><Icon src="abc"/><Text text="abc"/></Hbox>, but it creates alignment issues. Any ideas here?
    Thanks!
    Aamir

    855354 wrote:
    We are implementing pagination in our application and comparing the scrollable result set approach with using ROWNUM provided by oracle.The rownum approach scales better.
    Does this literrally mean that Oracle stores all the records in client-side memory cache? Well if it is scrollable it has to store all the rows somewhere, that is the disadvantage.
    Can we use fetchSize attribute or any other work around to limit the number of records in client-side memory?No. If you want that behavior that is how the rownum approach works.
    In the above case, when MAX_ROW_TO_FETCH is a large number (say 50000), then oracle will have to create a temporary table in memory with all the 50000 records and then will fetch from that table required records as per MIN_ROW_TO_FETCH.No, that is not how it works, where did you read that?
    In this case, reading rest of the records and storing in temporary in memory table will impact performance. Is my understanding correct or i am missing something here?Your understanding is not correct. The rownum approach does not work the way you think and behaves more like the way you want the scrollable result set to work.

  • Dynamic From statement in select query and/or outer join not working

    Dear Experts, I have a select query where the select columns are dynamic, the where condition is also dynamic. It is of the below format:
    Select (dynamic columns) INTO <wa>
    FROM a inner join b on af1 = bf1
    inner join c on af2 = cf2......
    WHERE (dynamic conditios)
    ORDER BY ( dynamic sort condition).
    Now I have to include some tables (dynamically depending on the user input) in the inner join statement which will give description for the selected fields. And these database tables may or may no be empty. So in this case, my select query will not return any data if these tables are empty. And I dont want that.
    I tried using outer join for the extra tables but it gave me a runtime error. I also tried forming the inner join statement dynamically but it was not supporting.
    Kindly give me pointers.
    Thanks

    Hey thanks for the reply, but the problem is not solved.
    I am already using  ( fileds, value) like table in my where condition and the select statement was working properly.
    the problem is that now I have to include some tables in the join statement which can be empty and so i want to use Outer join.
    But I am getting a runtime error as below:
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_DYNAMIC_OSQL_SYNTAX', was not
         caught in
        procedure "ZATSCSNG_RFC_READ_TABLE" "(FUNCTION)", nor was it propagated by a
         RAISING clause.
        Since the caller of the procedure could not have anticipated that the
        exception would occur, the current program is terminated.
        The reason for the exception is:
        The running ABAP program wanted to execute a SELECT statement whose
        WHERE condition was (partly) specified dynamically. The part that is
        specified in an internal table at runtime is compared to a field of the
        right table of an LEFT OUTER JOIN. Such comparisons are not supported by
         all database systems and are therefore not allowed.

  • The Power Query ribbon and the Power Pivot ribbon are gone !

    Hello,
    I created in Excel 2013, using Power Query, two large tables (more than 4 000 000 rows) according this principle: << However,
    the query pane that shows up on the side while data is loading lets you disable "load to worksheet". The data will continue to download. Once the download is done, you can click on "Load to Data Model" which will then get the data into
    the underlying xVelocity/data model.>>
    I built two calculated columns in order to create PRimary and Foreign keys for relations.
    I saved the xlsx file several times
    I Closed the xlsx file
    I reopened the xlsx file but, bad news, the
    Power Query ribbon and the Power Pivot ribbon are gone !
    I can check the the data connections are still there.
    What happened? What did I miss ?
    Thanks for your help
    Error message when I refresh connections :

    When I restart the computer, Power
    Query and Power
    Pivot ribbons come back. But if I enter a
    formula, they go away again.
    What could be the solution?

  • Pass values fromSharePoint list multi-selection list box to Infopath Multi-selection list box and back

    Design overview:
    List A
    InfoPath Library - Form A
    SharePoint Designer workflow
    List A has a multi-selection column with multi-values.
    Form A has fields populated from the data in List A by using a data connection in the form.  I have a workflow that updates the values or creates a new item in List A. All fields work except the mufti-selection. The multi-selection has ;# separating
    the values and I am having trouble setting the list box properly(checking of the selecting values) instead it concats all values on one line. I basically need to get the multi-selection column from list 1  to show exactly in the Form A and be able to
    update the selection with the workflow. I can do this with single values with no problem. the multi-selection list is difficult. I read somewhere I can use a repeating table but I am not sure the workflow will work with that. That is only a read and not 
    a write.

    Wow over my head a little. I understand what an array is with script but not how to write the script to handle it. I made this:
    event.value = getField("LISTBOX").value;
    But still no change in the behavior with multi selections. Example below if you want to check it out.
    https://dl.dropboxusercontent.com/u/2944617/formtext2.pdf

  • Power Query for Excel - Need Help with Oracle SQL Syntax

    Hello everyone,
    I am new to Power Query and am not able to figure this out.  I am trying to pull in data into my Excel spreadsheet using a specific Oracle SQL query.  While in query editor, how do I take the Oracle.Database function and add my SQL statement? 
    I already know what I want, I don't want it to download all the table names.  According to the help page, I should be able to do this but it does not provide a syntax example
    Also, I don't understand what "optional options as nullable record" means.
    Below is what function and arguments the help page notes.  How do I use this?
    Oracle.Database(server as text, optional options as nullable record) as table
    Any help is greatly appreciated.
    Thank you,
    Jessica

    When I try this, I get an error 
    DataSource.Error: Oracle: Sql.Database does not support the query option 'Query' with value '"Select * from Owner.View_Name"'. Details: null
    I'm trying to download oracle data from a view into power query - Power Query navigator does not list th eviews from my source, it lists only the tables. When I try write sql statements, it throws me the above
    error. This is what I tried
     Oracle.Database("Source/Service",[Query="Select * from Owner.View_Name"])
    Any ideas how to fix this? 

  • Add actions to an existing query or function in Power Query

    Hello
    I have just started using Power Query and can see this will be an amazing tool to add to my tool set. However I am rather slow on the uptake and am having trouble with some of the basics of using Power Query
    I have successful created some queries and by following along on some articles at excelguru.ca/blog i have created a usable function or two
    The issue i have and can see this being something i will do a lot in the near future (especially while still learning), is that I need to go back to the query and function and edit it. In particular i need to either rename some columns to make them compatible
    with other data sources, or delete them.
    I can see that i can manually edit the query / function in the advanced editor, but i was wondering if it is possible to open the report up again and edit the columns in the same manner as when creating them in the first place?
    Thanks in advance for any help given.
    I am using Excel 2010, although do have access to Excel 2013 if needed, but as i am using PowerPivot in 2010 i would prefer to use PQ in 2010 also.
    Proportal

    OK - What had completely stumped me, and i had to set it aside to do other things, has just been solved!
    To explain - obviously editing Queries is simple - right click the query and edit... and then make the changes you want.
    For functions - the thing i was really struggling with is also fairly simple, but takes a few more steps.
    1 - copy the query from the advanced editor
    2 - create a new blank query from Get External Data on the Home Tab / From Other Sources / Blank Query
    3 - Past your function in and remove the function statement(s) and reinstate and file path information
    4 - Edit the columns etc as you want.
    5 - when completed paste the relevent sections back into the original function.
    Done.
    Hope this helps any others out there that were struggling with something so simple... 
    Moral of this - copy and save all your queries and functions in a text editor such as notepad++ so you can cut out a lot of the steps above...

  • How to automate/parameterize/loop power query?

    Is it possible to write a single generic powerquery command that'll loop through a list of URLs and load the data to a single table? the webpages in question have the same format & table names, just the data contained within is different. I verified
    this by manually defining a powerquery from web import, importing, changing the url, and hitting refresh
    Is it possible to write a generic powerquery import to pull the data in and have it loop to append the data to a target worksheet?
    I tried macro recording some of the powerquery actions of defining an import but it didn't record anything so im assuming i cant use a vba loop to do this.
    I want to avoid having to manually define each from web import explicitly. There's a few hundred i'd need to do.
    Jakub @ Adelaide, Australia

    Here's a quick walkthrough for how to do something like this. I recommend reading through to the end before trying this, because there will a step later on which you'll actually want to do first to simplify things.
    Let's say I want to get presidential election results for multiple US States from Wikipedia. So to start, I use the "From Web" option inside Power Query and specify an URL of
    http://en.wikipedia.org/wiki/California. This lets me pick between several sections of the web page, and I choose the one called "Presidential elections results" and edit it. The results look good
    in the preview, so I go to the "advanced editing" view that shows me the M query:
    let
        Source = Web.Page(Web.Contents("http://en.wikipedia.org/wiki/California")),
        Data5 = Source{5}[Data],
        ChangedType = Table.TransformColumnTypes(Data5,{{"Year", type number}, {"Republican", type text}, {"Democratic", type text}})
    in
        ChangedType
    The numeric index "5" worries me a little because I suspect that there's not enough regularity in the Wikipedia pages for the US states for the 6th section to always be the one that I want. So I edit the query to index by the section name instead
    and confirm that it still produces the results I want:
    let
        Source = Web.Page(Web.Contents("http://en.wikipedia.org/wiki/California")),
        Data5 = Source{[Caption="Presidential elections results"]}[Data],
        ChangedType = Table.TransformColumnTypes(Data5,{{"Year", type number}, {"Republican", type text}, {"Democratic", type text}})
    in
        ChangedType
    Now I need to turn this into a function that can be applied to multiple pages. The only way to do that is to edit the M query directly, but the transformation is relatively straightforward. Again, I confirm that the output is still what I expected after
    making these changes.
    let
        Election.Results = (state) => let
            Source = Web.Page(Web.Contents("http://en.wikipedia.org/wiki/" & state)),
            Data5 = Source{[Caption="Presidential elections results"]}[Data],
            ChangedType = Table.TransformColumnTypes(Data5,{{"Year", type number}, {"Republican", type text}, {"Democratic", type text}})
        in
            ChangedType
    in
        Election.Results("California")
    Now, I want to apply this function to multiple web pages. These might come from a different Excel sheet or from an external file, but I'm just going to build a table of web pages manually. I'll keep the function around, but won't use it just yet in the overall
    formula. Once more, I confirm that the output is what I expect, which is a single table listing three states.
    let
        Election.Results = (state) => let
            Source = Web.Page(Web.Contents("http://en.wikipedia.org/wiki/" & state)),
            Data5 = Source{[Caption="Presidential elections results"]}[Data],
            ChangedType = Table.TransformColumnTypes(Data5,{{"Year", type number}, {"Republican", type text}, {"Democratic", type text}})
        in
            ChangedType,
        States = Table.FromRows({{"California"}, {"Idaho"}, {"Massachusetts"}}, {"State"})
    in
        States
    Now I can use the "Insert Custom Column" feature of the UI to apply my function to the State column. This looks like "=Election.Results([State])" in the dialog. But when I click OK, something unpleasant happens: I get prompted several
    times for "data privacy" settings for each of the URLs I'm trying to access. This is quite annoying, and we're looking for ways to improve the experience -- perhaps by letting you pick that the privacy settings apply to all of
    http://en.wikipedia.org and not just to the specific URL you're trying to access.
    Meanwhile, you can achieve the same thing manually with a kind of underhanded trick by creating a throwaway query which references
    http://en.wikipedia.org and one other website, and using the "data privacy" prompt from that query to define a privacy rule for the entire domain. Exit the editor and create a new "Blank Query" with
    this single formula: "= Binary.Length(Web.Contents("http://en.wikipedia.org")) + Binary.Length(Web.Contents("http://www.bing.com"))" This will prompt
    you to pick a privacy setting for those two websites (I would suggest that "Public" is the right choice). Once you've done that, you can discard this query; its work is done.
    Now if you go back and repeat the steps for the "elections" query, you'll avoid the privacy prompt.
    At this point, you'll have a table with two columns: one that has the state, and one that has the results as Table values. We want to expand out those values, so we click on the expansion indicator in the column header for Custom and pick all fields. The
    result is a table with four columns: State, Custom.Year, Custom.Republican and Custom.Democratic. The latter three fields can be renamed from either the UI or by editing the M code. In my case, I ended up with a program which looks like this:
    let
        Election.Results = (state) => let
            Source = Web.Page(Web.Contents("http://en.wikipedia.org/wiki/" & state)),
            Data5 = Source{[Caption="Presidential elections results"]}[Data],
            ChangedType = Table.TransformColumnTypes(Data5,{{"Year", type number}, {"Republican", type text}, {"Democratic", type text}})
        in
            ChangedType,
        States = Table.FromRows({{"California"}, {"Idaho"}, {"Massachusetts"}}, {"State"}),
        InsertedCustom = Table.AddColumn(States, "Custom", each Election.Results([State])),
        #"Expand Custom" = Table.ExpandTableColumn(InsertedCustom, "Custom", {"Year", "Republican", "Democratic"}, {"Year", "Republican", "Democratic"})
    in
        #"Expand Custom"
    And the job is done!
    Actually, the hard part might just be getting started. Finding a set of web sites which is consistent enough for a single parsing function to work can be rare. As an example, when I tried to add "Washington_(U.S._state)" to my list of states, I
    discovered that its table was formatted differently than the others. And when I tried to add "New_york_state" to the list of states, I found that its section was named "New York State Presidential Election Results" instead of just "Presidential
    election results". So it's possible that you'll have to do an awful lot of tweaking.
    Nonetheless, this should cover the basic steps and help you get started.

  • Aggregating across many-to-many relationship in Power Query?

    Hi, another M question.
    I am trying to push all my DAX calculated column logic back to Power Query and what I couldn't figure out is how to aggregate across my many to many relationship.
    Customer has many companies. He has sales for each company on a bunch of dates. Also, he has timesheets for each company for each date. Customer would like to calculate the labour cost for each company and show them as a ratio of sales in the sales report.
    (eg Kitchen labour cost should be x% of food sales)
    Now I am fine writing all the measures in DAX because I can put them in a table isolated from the Power Query tables. But calculated columns I would ideally push back to Power Query. 
    This is the DAX I constructed to put a calc column in the SalesReport table for the Kitchen labour costs
    =CALCULATE(SUM(Timesheet[Labour Cost]), FILTER(Bridge_CompanyDate, Bridge_CompanyDate[CompanyDateKey]=SalesReports[CompanyDateKey]), FILTER(Timesheet, Timesheet[Category]="Kitchen"))
    Is there a way to do similar types of aggregation in Power Query? I am tired of rewriting these calc columns when I have to reload the thing in the data model :(
    Thanks

    Hi Cathy. You can do this kind of calculation in Power Query, but it's not quite the same as in Power Pivot/DAX.
    If I understand your DAX expression correctly, you're wanting the sum of the [Labour Cost] column from the Timesheet table, for all rows with a [Category] of "Kitchen", where the timesheet date matches the date of the current row in the SalesReport table.
    In M, this would look something like this:
    = Table.AddColumn(Source, "Kitchen Labour Cost", each let expectedDate = [Date] in List.Sum(Table.SelectRows(Timesheet, each [Category] = "Kitchen" and [Date] = expectedDate)[Labour Cost]))
    (Instead of going through the Bridge_CompanyDate table, I'm matching the SalesReport and Timesheet dates directly just to make the example simpler.)
    Let me know if that helps.
    Ehren

Maybe you are looking for

  • Script fails when passing values from pl/sql to unix variable

    Script fails when passing values from pl/sql to unix variable Dear All, I am Automating STATSPACK reporting by modifying the sprepins.sql script. Using DBMS_JOB I take the snap of the database and at the end of the day the cron job creates the statsp

  • IMessage won't slide ON.  iOS 8.2.1 update issue

    I updated my iPhone 6 to 8.2.1 yesterday and I noticed all day that my messages were stuck in the send receive mode. So, I checked by MESSAGES in my settings and noticed that my iMessage slider was OFF.  I tried to slide it ON and it just slides back

  • Compensation for loss of Internet

    Do BT offer compensation for loss of your Internet conection if the fault is on their network, if so how many days loss of internet service is the minimum you can claim for, and do you actually have to file a claim or is this done automatically ? tia

  • How to specify ServerSide event type (with Naming Containers) in a function

    I have a java script function ... function clientMethod(event) { component = event.getSource(); AdfCustomEvent.queue(component, "generateEvent",{},true); event.cancel(); My jspx Page has <af:pageTemplate viewId="/templates/MyMainTemplate.jspx" id="ma

  • ZEBRA PROGRAMMING FOR SHIPPING LABEL

    Hi gurus, i have one assignment for creating shipping label using zebra programming into SAPSCRIPT. page size is 5 inch X 7 inch. I also want to draw a circle and in that  circle i want to write P\B . i.e. no lead symbol. can anybody give me the samp