User Profile
RZ
Frequent Visitor
Joined 3 years ago
User Widgets
Contributions
Re: Mashup Exception: Any ideas to try?
OK. I had two calls with Microsoft Support without a resolution yet. But in the meanwhile I found a way around it, as I was able to get closer to the core issue. The function GetRelated(id) was accepting id as any. Changing this to text fixed the issue. I also had to create another version when I needed to call the function with a record. Maybe this will help someone... Ruchan2KViews0likes1CommentMashup Exception: Any ideas to try?
I have been trying to solve a MashUp exception error for some time now. I have managed to simply the problem as follows. I have a main and related table, they have a common id between themselves. For debugging purposes the main table has only one column "id" and one row. And I have a function GetRelated(id) that retrieves the related records from an API given an id. When I add a column with a call to this function referencing the id and then remove the column; DataFlow gives a MashUp Exception when published but looks fine in the PowerQuery Editor. Just a note: the error is the same if I dont remove the column. Fail let Source = mainTable, #"Invoked Custom Function" = Table.AddColumn(Source, "related", each GetRelated([id])), #"Removed columns" = Table.RemoveColumns(#"Invoked Custom Function", {"related"}) in #"Removed columns" However if I retrieve the related records outside the failing query in another table... GetRelatedInAdvance: let Source = GetRelated("98035f6c-e16f-46cd-9fea-08db04f8aa2f") in Source And then add this table into a column let Source = mainTable, #"Invoked Custom Function" = Table.AddColumn(Source, "related", each GetRelatedInAdvance), #"Removed columns" = Table.RemoveColumns(#"Invoked Custom Function", {"related"}) in #"Removed columns" The flow works. Looks the same as the failing one in the editor. What else should I look into? Thanks RuchanSolved2.1KViews0likes4CommentsUnexpected behaviour in Power Query
Hello, I have a Power BI report that connects to variouys data sources (files, API) and brings them together. I made some changes yesterday, And I started getting dataformat.error's during refresh. The error is not associated with one row. Instead the whole step fails. After some backward steps to identify the issue , now I am at a stage where I am getting the error DataFormat.Error: We couldn't convert to Number. Details: True at the sorting step where I was hoping to find some problematic data... The immediate step before refreshes fine. It s the step where I converted the values to text in order to debug if something was wrong with the data I have,,, Any suggestions? Thanks... Ruchan843Views0likes3CommentsRe: How to dynamically/recursively add columns to generate permutations..
Thanks, Not very elegant but I managed to get it working by passing previousState and iteration count down the iteration thanks to your push to the right direction. (N as number, k as number, optional prevStep as any, optional iteration as number) as any => let decisionslist1 = Table.FromList(List.Generate(()=>[x = 0, y=0],each [x] <= N, each [x=[x]+1,y=Number.Power(2,x-1)],each [y]), Splitter.SplitByNothing(), null, null, ExtraValues.Error), iteration = if iteration is null then 1 else iteration, prevStep = if prevStep = null then decisionslist1 else prevStep, cartesian = Table.AddColumn(decisionslist1, "Custom", each prevStep), expanded = Table.ExpandTableColumn(cartesian, "Custom", {"Column1"}, {"Column1.1"}), renamed = Table.RenameColumns(expanded,{{"Column1", "a"}, {"Column1.1", "b"}}), select = Table.SelectRows(renamed,each ([a] <> [b]) or (Number.From([a]) = 0 and Number.From([b])=0)), sum = Table.AddColumn(select, "Column1", each [a]+[b]), removeDuplicates = Table.Distinct(sum, {"Column1"}), removedcolumns = Table.RemoveColumns(removeDuplicates,{"a", "b"}), decisionlist2 = if iteration = k then prevStep else GetPermutations(N,k,removedcolumns, iteration+1), out = decisionlist2 in out coupling this with the toBinary function from Solved: Re: Number to Binary - Microsoft Fabric Community I am able to create the binary numbers(states/decisions for my purpose) up to k set bits at an acceptable performance... for N=8, k=2... Column1 toBinary 0 000000000000000000000000 1 000000000000000000000001 2 000000000000000000000010 3 000000000000000000000011 4 000000000000000000000100 5 000000000000000000000101 6 000000000000000000000110 8 000000000000000000001000 9 000000000000000000001001 10 000000000000000000001010 12 000000000000000000001100 16 000000000000000000010000 17 000000000000000000010001 18 000000000000000000010010 20 000000000000000000010100 24 000000000000000000011000 32 000000000000000000100000 33 000000000000000000100001 34 000000000000000000100010 36 000000000000000000100100 40 000000000000000000101000 48 000000000000000000110000 I would have shared a more generic function if I could, will do maybe one day if I can.751Views0likes0CommentsHow to dynamically/recursively add columns to generate permutations..
Hello, I am working on generating permutations for a specific applications. Basically the problem is there are N steps (24 as of now but can change) and at each step there is a decision to be made. And based on this decision I will be making a calculation. And the maximum number of decisions that can be made is also a parameter. (k) So for N = 4, k=1 the possibilities are; 0000 0001 0010 0100 1000 And for N=4, k=2 the possibilities are; so k=n includes k=n-1... 0000 0001 0010 0100 1000 0011 0101 0110 1001 1010 1100 I thought (not verified) the fastest way to generate the k=1 values is to generate a list of values 2^0...2^N and convert them to binary if I need a visual representation. decisionslist1 = = Table.FromList(List.Generate(()=>[x = 0, y=0],each [x] <= N, each [x=[x]+1,y=Number.Power(2,x-1)],each [y]), Splitter.SplitByNothing(), null, null, ExtraValues.Error) decimal - binary 0 0000 1 0001 2 0010 4 0100 8 1000 And then for k=2 (and potentiallyfor all the next k) a sensible approach seemed to cartesian product the previous list with itself add the values and eliminate duplicates. I could write the code for k=2 but I can't figure out a way to make it generic, which I think requires dynamically adding columns or recursion. let N = 4, decisionslist1 = Table.FromList(List.Generate(()=>[x = 0, y=0],each [x] <= N, each [x=[x]+1,y=Number.Power(2,x-1)],each [y]), Splitter.SplitByNothing(), null, null, ExtraValues.Error), cartesian = Table.AddColumn(decisionslist1, "Custom", each decisionslist1), expanded = Table.ExpandTableColumn(cartesian, "Custom", {"Column1"}, {"Column1.1"}), renamed = Table.RenameColumns(expanded,{{"Column1", "a"}, {"Column1.1", "b"}}), select = Table.SelectRows(renamed,each ([a] <> [b]) or (Number.From([a]) = 0 and Number.From([b])=0)), sum = Table.AddColumn(select, "Custom", each [a]+[b]), removeDuplicates = Table.Distinct(sum, {"Custom"}), decisionlist2 = Table.RemoveColumns(removeDuplicates,{"a", "b"}) in decisionlist2 outputing decimal - binary 0 0000 1 0001 2 0010 4 0100 8 1000 3 0011 5 0101 9 1001 6 0110 10 1010 12 1100 How can I convert this into a generic function does this k-1 times taking k as an input? I understand power query is not the ideal environment for such work but I am unfortunately there... Thank you Ruchan ZiyaSolved804Views0likes2CommentsDynamic Real-Time Simulation X-Axis
Hello, I have second resolution calculated/simulated data. The data is forecast data covering the the next year. I am trying to build a demo dashboard that would display a current window of 20 + 1 seconds worth of data. I tried calculated columns or measures or calculated tables by filtering according to current time ... i.e. LiveViewValue = IF(AND(secondresolution[timestamp]>(NOW()-20/(24*60)),secondresolution[timestamp]<NOW()+1/(60*24)),secondresolution[measurement],BLANK()) But I can't make the calculations, measures that refer to NOW() refresh themselves... I wonder if it is doable.. Any suggestions?417Views0likes0CommentsRe: Datetime import issues
Hi Xiaoxin Sheng, The issue is the imported values are not the same as the original values. The first screenshot shows a cell value of 10/04/2022 12:00:00 in excel. When this gets in PowerQuery it is displayed as the same in the column view but when you click on the cell you see that the value has actually become 10/04/2022 11:59:59.9990000. That I became aware when I used the a column to extract the Minute(). The funny thing is: I have a year worth of hourly data and the values before 10/04/2022 12:00:00 import fine but the ones after all have the same issue. I found a way around that, I extract the minute in excel and import afterwards. But the behaviour is strange and would like to understand why that happens. But as of now I will double check my datetime imports.1KViews0likes0Comments
Data Privacy
Microsoft Fabric Community and Privacy
To learn more about how we manage your data, please review the Microsoft Fabric Community Data Privacy guide.