powerbi

DAX grouping by a measure result

北城以北 提交于 2019-12-11 05:42:25
问题 Need some help here grouping a measure result for a visual in PowerBI using DAX. I have a table that displays all visits by certain customers (Visits table). I have a measure that counts the number of visits for each day, and I have a date slicer (visit day). The results of this measure usually range between 1 and 10. I am trying to see a frequency of customers visits per year. If they have 1 = single visit 3 or more visits = returning customer 7 or more visits = frequent customer. I am

QoQ Measures in Power BI

谁都会走 提交于 2019-12-11 04:59:03
问题 I am looking to do a QoQ calculation in a table. The problem I am facing is that I do not know how to calculate the previous value while the current value also shows. I would then use that field to create a difference or % difference. Hopefully the following example makes it clear. Sample data: Quarter | Year |Product| Measure Q1/19 | 2018 | A | 22 Q1/19 | 2018 | B | 61 Q1/19 | 2018 | C | 187 Q2/19 | 2018 | A | 121 Q2/19 | 2018 | B | 31 Q2/19 | 2018 | C | 15 Q3/19 | 2018 | A | 68 Q3/19 | 2018

Calculated column with the sum of values from many columns in a row

陌路散爱 提交于 2019-12-11 04:46:33
问题 I need to sum all values in each row and display them in a calculated column. As I deal with lots of columns in lots of tables, adding something like CalculatedColumn = 'public table_name'[column1] + 'public table_name'[column2] + ... + 'public table_name'[column528] is really inefficient. Is there a shorter way of doing this? 回答1: Yes, there is. You should "Unpivot other columns" and then "Group By" using the Query Editor. Suppose this dataset: item;col1;col2;col3;col4;col5 apple;1;2;3;4;5

Power query recursive function: add more steps after the recursive step

♀尐吖头ヾ 提交于 2019-12-11 04:35:01
问题 Background: I have posted a question regarding a custom function in Power Query that I found in a blog by Chris Webb which I have already got an answer to.But now I have another question related to the same custom function. One of the amazing steps in that custom function is the recursive step at the end named " OutputTable " which calls itself using a if statement, basically making it a loop . Below is the step: OutputTable = if NextColumnNumber>(Table.ColumnCount(ExpandedTable)-1) then

When using Group By in PowerBI desktop Column value is not active

烈酒焚心 提交于 2019-12-11 04:27:17
问题 In my data set, each PolicyNumber can have multiple ClaimNumber . So all I want to do is to get Unique PolicyNumber and Count the number of Claims ( ClaimNumber ) for each PolicyNumber . (Like a pivot table in Excel) In Power BI I click Edit Query , click Group By , specifying the column I want to group on which is PolicyNumber , giving the name to new column ( CountOfClaims ), Operation - Count Rows ...but I am unable to choose Column value. For some reason its inactive. It works if I need

Power BI Rolling Total Previous Month DAX

佐手、 提交于 2019-12-11 04:25:14
问题 I am working in POWER BI and trying to calculate a DAX expression for the rolling total of the previous month. I have a filter where I select a certain month, I would like to calculate the rolling total for the previous month. Below is the calculation that works perfectly to calculate the rolling total for the selected date range. How can I calculate the previous months rolling total? Rolling_Total_Current_Month = CALCULATE( SUM(SalesInvoice[Sales]) ,FILTER(ALLSELECTED(SalesInvoice),

Automatically Expand all “Table Columns” with specific name

坚强是说给别人听的谎言 提交于 2019-12-11 02:52:09
问题 I'm a beginner in coding and am not familiar with "M" modeling language. I have an XML file that I want to use to load the data in Query Editor. In the Query, I need to expand only the table columns with a specific name below: view viewfolder Attribute:name I have found the following post where they give a function by Chris Webb for expanding all the lists(below code). = (TableToExpand as table, optional ColumnNumber as number) => let ActualColumnNumber = if (ColumnNumber=null) then 0 else

What is happening under the hood when a relationship is established between tables?

那年仲夏 提交于 2019-12-11 02:46:46
问题 This question is not limited to Power BI, but it will help me explain my problem. If you have more than one table in Power BI, you can establish a relationship between them by dragging a column from one table to the other like this: And you can edit that relationship by clicking the occuring line: And by the way, here are the structures of the two tables: # Table1 A,B 1,abc 2,def 3,ghi 4,jkl # Table2 A,C 1,abc 1,def 2,ghi 3,ghit This works fine since column A in Table1 consists of unique

How to refresh report that uses custom functions on Power BI Service?

懵懂的女人 提交于 2019-12-11 02:26:37
问题 I know this issue has been posted many times before, but I was not able to get a solid/working solution. I am trying to figure out a workaround for refreshing dataset with Custom functions over Power BI service. My query looks like the following: let Clients = Json.Document(Web.Contents("https://api.createsend.com/api/v3.2/clients.json")), #"Converted to Table" = Table.FromList(Clients, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Expanded Column1" = Table.ExpandRecordColumn(#

BI Designer many to many relationship

大憨熊 提交于 2019-12-11 02:21:21
问题 I am new to Microsoft Power BI designer and noticed this documentation that mentions being able to do a many to many join within the tool. When I try to do the many to many join, I receive an error that says "You can't create a relationship between these two columns because one of the columns must have unique values. Am I doing something wrong? Thanks in advance. 回答1: This is an error in the documentation. As you've noted, you can't specify this in the relationship dialog. Many to many