Hi, All!
I am trying to add a column with what in excel would be =PERCENTRANK.INC([column_name],$B3)
essentially, "column_name" are all rows within the column.
Any thoughts?
Thanks!
Hi, All!
I am trying to add a column with what in excel would be =PERCENTRANK.INC([column_name],$B3)
essentially, "column_name" are all rows within the column.
Any thoughts?
Thanks!
Hello
I´m trying to creat a table based in annother table using Table.FirstN conditional.
But I don´t know how to write a conditional that helps me to only select the data that are numbers in the colum,
until the first text type data appears like this:
Hello
I would like to to calculate date range and add filter date to show data in range of dates.
to make it more clear, I want to add filter (slicer) as checklet that has the types below
ID -----|---- TYPE
1-------|----Today
2-------|----Yesterday
3-------|----Last 7 Days
4-------|----MTD
let's assume that there is a simple table with date column "select ITEMID, Factory,CretedDT FROM Xtable" what I have to do is making relationship between the slicer that I added before and this Xtable
I tried to add new coulmn in SQL server using case statement as showing below
select
ITEMID,
Factory,
case
when [CretedDT ] = CONVERT(DATE,GETDATE()) then 1
when [CretedDT ] = dateadd(day,-1, cast(getdate() as date))then 2
when [CretedDT ] >= DATEADD( DAY, DATEDIFF(DAY, 0, GETDATE()) - 7, 0) then 3
end as Filter_Date
FROM Xtable
but this method has a problem, it would mean I cant include neither today (1) type nor yesterday (2) type into Last 7 days type (3), it is always be only one type, therefore the data wont be accurate, what if the user choose type number 3 the data of yesterday and tody wont appear.
is there any way to simplify what I need and do it directly from Power BI by using measures or adding conditional coulmn?
NOTE: The data connectivity mode is DirectQuery
Hello
I would like to to calculate date range and add filter date to show data in range of dates.
to make it more clear, I want to add filter (slicer) as checklet that has the types below
ID -----|---- TYPE
1-------|----Today
2-------|----Yesterday
3-------|----Last 7 Days
4-------|----MTD
let's assume that there is a simple table with date column "select ITEMID, Factory,CretedDT FROM Xtable" what I have to do is making relationship between the slicer that I added before and this Xtable
I tried to add new coulmn in SQL server using case statement as showing below
select
ITEMID,
Factory,
case
when [CretedDT ] = CONVERT(DATE,GETDATE()) then 1
when [CretedDT ] = dateadd(day,-1, cast(getdate() as date))then 2
when [CretedDT ] >= DATEADD( DAY, DATEDIFF(DAY, 0, GETDATE()) - 7, 0) then 3
end as Filter_Date
FROM Xtable
but this method has a problem, it would mean I cant include neither today (1) type nor yesterday (2) type into Last 7 days type (3), it is always be only one type, therefore the data wont be accurate, what if the user choose type number 3 the data of yesterday and tody wont appear.
is there any way to simplify what I need and do it directly from Power BI by using measures or adding conditional coulmn?
NOTE: The data connectivity mode is DirectQuery
I wanted the first and last name removed from our company email address and have each name Capitalised. Thanks to Text.Proper:
let
Name = (email as any) =>
let
Source = if email = null then
""
else
Text.From(email),
removeDomain = Text.BeforeDelimiter(email,"@"),
replaceDot = Text.Replace(removeDomain,"."," "),
fullName = Text.Proper(replaceDot)
in
fullName
in
Name
I'm loading data in a .pbix from Oracle to work in an import mode with a Pro Licence.
Are there any differences between load the physical tables with index or the tables without index?
I am trying to add several different columns from different tables and I do not understand what function must be used for the measure.
This is what I have tried...
Hi folks,
It looks like Power Query truncates imported fields to 1020 characters. I have seen this when loading JSON field from MySQL data source. Is there a remedy to this, I wonder?
Thanks in advance !
Hello all,
I come to you with an issue that I encounter on Power Query.
Basically, I have a data set with a column made of all types of data : numbers, texts, dates...
I created an M command as a new row, to show the data type for each cell of that column :
--> Value.Type([Column])
So far, it works relatively well : it creates a column with data displayed in yellow, stating "Type" and when I click on it, it shows the data type.
--> Yet, when I go to Power BI Viz and fetch that column (e.g. in a Table), it shows [Type] and not the actual type inside.
What I want to do is basically create an additionnal column in my data set and have the data type specified next to the value.
- e.g. if it's a date, it is written DATE, etc...
I am new to M and tried several things but it did not do anything good. Furthermore, while checking on the web for other related threads, I haven't found what I'm looking for.
--> I assume this is pretty simple though, as the column is created and the type inside is reckognized.
I have added two photos to illustrate my issue :
- First photo is the command written in M
- Second photo is the visual result in Power Query
Many thanks for your help and explainations in particular !
Regards,
Command in M
Visual Result
Hello
I´m trying to create a filter using the columns, because I want to Graph different lines in one graphic but not at the same time, in that way you are going to be able to choose which line you want to see. In the left side of the image are the columns that I want to use
I am writing a power query to run a web scraper that goes through a list of ID's in my dataset and searches for them in a search bar on a site. For some reason, Power BI is adding ".0" to the end of every number.
So my code takes the ID from the dataset and converts it to a list. Then it converts the ID's to strings and strips the 00's at the beginning of the ID:
FRID_list = dataset["FRID__c"].tolist()
FRID_listn = [str(z) for z in FRID_list]
new_frid =[]
for q in FRID_listn:
q.lstrip('0')
new_frid.append(q.lstrip('0'))
Then it iterates through that list, and types it in to a search bar:
for ID in new_frid:
browser.fill('query', 'FRID ' + ID + '\n')
When I run the code as a python visual, it works fine, but if I run it in the power query, it adds .0 to the end of the ID:
It doesn't do that in the regular python visual though. I though initially that it was turning it in to a float, but the code specifically turns it in to a str to it can be stripped. Can someone please advise why this is doing this and what I can do to fix it?
I am using HTTP POST to reach a data API that provides a JSON response which contains a URL to the actual report data in CSV form (JSON option available too).
If I try to use the URL as a parameter in another query I get the Formula Firewall issue. I tried integrating the two queries together but I still get that error..
Here's the query that provides the URL for the CSV (with some parts of the URL and headers removed):
let Source = Json.Document(Web.Contents("https:/blahblah.com/report_type?companyKey=***Key***&startTime=1559313000000&endTime=1561905000000&.....&reportFormat=CSV")), result = Source[result], downloadUrl1 = result[downloadUrl] in downloadUrl1
The output of this is a URL, I can turn it into a parameter and attempt to use it in the next query (parameter is called "p_URL"):
let Source = Csv.Document(Web.Contents(p_URL),[Delimiter=",", Columns=81, Encoding=65001, QuoteStyle=QuoteStyle.None]) in Source
Output should be a data table from the CSV, and it works when I enter in the actual URL from the first query, but when I use the parameter or nest the first query inside the second one I get this:
Formula.Firewall: Query 'download?companyKey=***Key***' (step 'Source') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.
Farily new with DAX and struggling with filtered RANKX. I have a StatsDB table and a playerkey table for a fantasy football database I'm working on.
Each row of the data table is a game log for a player:
StatsDB:
PlayerKey
I created measures that calculate fantasy points based on stats.
Example Measures:
I have a points rank that seems to work for the context of the pivot / slicers -
However, my goal is to have a "fantasy points positional rank" measure. Where did a player rank in fantasy points scored at his position over any given period of time?
Any ideas how to go about this? Would be much appreciated! I can do this manually but am trying to work positional ranks into the data model and am stuck.
Hi everyone,
I was following the post below to connect to the dataset in our organizational workspace.
https://docs.microsoft.com/en-us/power-bi/service-premium-connect-tools
I was able to establish a connection successfully, however, one thing I noticed was that the push dataset I created was missing. Is this by design or I actually missed something (like permission setting I guess) to connect to the push dataset in SSMS? The other datasets (created by uploading the pbix files to the workspace) works fine in the SSMS.
Hi
Due to the Power BI and Salesforce limitation of a maximum of 2,000 rows per query, I have had to split a report into 8 seperate reports.
When I publish to my workspace and go to schedule refresh I get an error saying my refresh token has expired.
When I reduce the number of reports to 5, so remove 3 of the reports that I still actually need, the schedule refresh then goes back to working.
Is there a set limit of reports that can be schedule to refresh?
Regards
Water_Hydration
Hello community,
I've stumbled upon many threads about JSON files and how to use them in Power BI, but I can't however find the issue that I am facing.
My JSON has a number of levels which I expand to reach. I than do an unpivot step to reduce the number of columns (which contain records). The column that remains I than have to expand again. However these "columns" have many values which with every new dataset are different. The way I use this now forces me with every refresh to to go into the query editor and select all the columns manually to be able to expand them all. In M language it looks like this:
let
Source = Json.Document(File.Contents("Location of JSON file")),
#"Converted to Table" = Record.ToTable(Source),
#"Expanded Value" = Table.ExpandRecordColumn(#"Converted to Table", "Value", {"afspraken / acties"}, {"afspraken / acties"}),
#"Expanded afspraken / acties" = Table.ExpandRecordColumn(#"Expanded Value", "afspraken / acties", {"actielijnen"}, {"actielijnen"}),
#"Expanded actielijnen" = Table.ExpandRecordColumn(#"Expanded afspraken / acties", "actielijnen", {"werk", "veiligheid en geborgenheid", "ontwikkeling", "werk / daginvulling", "vrije tijd", "samenleven", "financiën", "wonen", "inkomen", "gezondheid", "algemeen"}, {"werk", "veiligheid en geborgenheid", "ontwikkeling", "werk / daginvulling", "vrije tijd", "samenleven", "financiën", "wonen", "inkomen", "gezondheid", "algemeen"}),
#"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Expanded actielijnen", {"Name"}, "Attribute", "Value"),
#"Expanded Value3" = Table.ExpandRecordColumn(#"Unpivoted Columns", "Value", {"administratie op orde brengen", "huishouden op orde brengen", "verwijderen 2", "test", "test verwijderen", "teststete", "x", "xx", "ww", "gsfhsf", "wrtyw5y", "vyudvqlud", "rtrwt", "rotwet", "rtreqteqt eq", "erewr", "huxfdhgiugf iu", "tdifiytf kyf", "ewrw", "erqteqteq tetrert", "ryryryryr"}, {"administratie op orde brengen", "huishouden op orde brengen", "verwijderen 2", "test", "test verwijderen", "teststete", "x", "xx", "ww", "gsfhsf", "wrtyw5y", "vyudvqlud", "rtrwt", "rotwet", "rtreqteqt eq", "erewr", "huxfdhgiugf iu", "tdifiytf kyf", "ewrw", "erqteqteq tetrert", "ryryryryr"}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Expanded Value3", {"Name", "Attribute"}, "Attribute.1", "Value"),
#"Expanded Value2" = Table.ExpandRecordColumn(#"Unpivoted Other Columns", "Value", {"datum", "beschrijving", "gereed", "wie", "resultaat", "vervolg", "beschrijving-aantal"}, {"datum", "beschrijving", "gereed", "wie", "resultaat", "vervolg", "beschrijving-aantal"})
in
#"Expanded Value2"
The whole dataset only contains dummy data so luckily I can share this, the example is about the table called "actielijnen":
Now I'm looking for a way that selecting the columns goes automatically and I don't have to select them first. This is dummy data but the real database contains 10.000's of records and therefore it's not workable to manually select with every refresh.
I thank you kindly in advance for any assistance!
Kind Regards,
Chris
Hello,
I'm searching for an explanation of the following problem:
I'm developing a lot of PowerQuery queries and recently, I had to use Expression.Evaluate:
Expression.Evaluate("my expression using the internal function Text.Upper ", #shared)
It works in Power BI Desktop. When I publish my dataset to PBI Service (Premium) and let it refresh, the following error comes:
Does anybody have an idea why it doesn't work?
Actually, I have a workaround for my current case, but it is not a general solution:
Expression.Evaluate("my expression using the internal function Text.Upper ", [Text.Upper = Text.Upper])
EDIT: Or if you need a list of all Text.* function names in PowerQuery, you can create it manually in advanced and use it as a record for the new scope:
let Shared = #shared, TextFunctionNames = List.Select(Record.FieldNames(Shared), each Text.StartsWith(_, "Text.")), Result = List.Transform(TextFunctionNames, each _ & " = " & _ & ",") in Result
Thank you very much for an explanation or a hint in advanced.
Best regards,
Hi,
I'm extracting data from an API containing financial data for which I first have to send a query to select the desired administration. The company for which I'm doing this has 5 administrations.
The sequential queries look like this data1 -> select2 -> data2 -> select3 -> etc
I've disabled the parallel loading of tables to get the required result. I need the select queries to run before the corresponding data query.
This results in 10 tables being loaded to my report, and this is only the financial data. More data is to be added in the future. Is there a more elegant way to do this? If I merge the data queries in power BI the select queries are not executed and I get 5 copies of the same administration. Any ideas?
I have a table like this imported to power query
Vehicle number | Customer name | Vehicle type | Amount |
550 RLA | Toomas | New | 1 |
885 ASS | Toomas | Used | 1 |
854 PPT | Toomas | New | 1 |
754 TYU | Anne | Used | 1 |
125 ASK | Anne | Used | 1 |
855 ANN | Juss | New | 1 |
999 SVE | Juss | Used | 1 |
I would like to add a custom column so that the column says if the customer only has Used vehicles or not. In this case it would look like this:
Vehicle number | Customer name | Vehicle type | Amount | Only used vehicle customer |
550 RLA | Toomas | New | 1 | No |
885 ASS | Toomas | Used | 1 | No |
854 PPT | Toomas | New | 1 | No |
754 TYU | Anne | Used | 1 | Yes |
125 ASK | Anne | Used | 1 | Yes |
855 ANN | Juss | New | 1 | No |
999 SVE | Juss | Used | 1 | No |
Is this doable in power query? If so then how?
Thanks!
I have this basic filtering line of code that will return only entries where the column Name does not contain any of the words: "changed", "old" or "GSTable"
KeepOnlyDateText = Table.SelectRows(ShowFiles, each Text.Contains([Name], "changed") = false and Text.Contains([Name], "old") = false) and Text.Contains([Name], "GSTable") = false),
Is this possible to put these exclusion words into a list and refer to it? I tried:
KeepOnlyDateText = Table.SelectRows(ShowFiles, and List.Contains(CSVExcludeKeywords,[Name]) = false),
But this does not seem to filter anything out.