dax

Getting the PERCENTRANK.INC in PowerPIvot/DAX

爷,独闯天下 提交于 2019-12-24 07:09:57
问题 I have been tasked with converting a a worksheet from standard Excel into PowerPivot. However, I have hit a roadblock with the PERCENTRANK.INC function which is not available in DAX. I have come close to replicating it using a formula, but there are definite differences in the calculation. Does anyone know how Excel calculates PERCENTRANK.INC()? Formula in cell D2: =(COUNT($A$2:$A$10)-B2)/(COUNT($A$2:$A$10)-1) Formula in cell B2: =RANK.EQ(A2,$A$2:$A$10,0) Formula in cell C2: =PERCENTRANK.INC(

Is it possible to use a slicer as a parameter to a DAX Summarize function?

故事扮演 提交于 2019-12-24 06:44:25
问题 I have a FactLosses Table, and a DimAccumulation table. I have brought them into PowerBi and I have placed a slicer to choose which accumulation zones i am interested in. Once the user has selected the zones, i want to perform a group by year on the losses and sum the losses into year buckets. But only on the data that applies to the zones the user picked. I am using the following DAX code to do the group by like so... Table = SUMMARIZECOLUMNS(FactForwardLookingAccumulation[Year], "Losses By

Is it possible to use a slicer as a parameter to a DAX Summarize function?

谁说胖子不能爱 提交于 2019-12-24 06:44:14
问题 I have a FactLosses Table, and a DimAccumulation table. I have brought them into PowerBi and I have placed a slicer to choose which accumulation zones i am interested in. Once the user has selected the zones, i want to perform a group by year on the losses and sum the losses into year buckets. But only on the data that applies to the zones the user picked. I am using the following DAX code to do the group by like so... Table = SUMMARIZECOLUMNS(FactForwardLookingAccumulation[Year], "Losses By

Sumif equivalent in PowerBI doesn't work properly with DAX function

帅比萌擦擦* 提交于 2019-12-24 06:36:47
问题 I try to use SUMIF equivalent in PowerBI. I have read already a lot of similar topics describing the usage of CALCULATE and SUM combined with FILTER functions. But none of them could help me with my problem. What I want to do: A production line writes a time stamp into a CSV file when it starts an event (e.g. machine starts, machine stopps etc.). The CSV file is processed by PowerQuery in a way that all start dates are available in one column of a table. The column is called "Event Start". To

How can I do a customer segmentation for month and see the customer number filtered?

隐身守侯 提交于 2019-12-24 06:29:21
问题 This is the output I would obtain https://i.stack.imgur.com/er8Du.png This is the sample pbix I have done https://mega.nz/#!lg9GASzR!D861nKR8cFGlm4eNyEa2BTep3ku_M5JjktvITAePmQ4 I would obtain the number of customers for each month with the label defined in the measure m-mark = IF([sumlast3months]=3;"Gold"; IF([sumlast3months]=2;"Silver"; IF([sumlast3months]=1;"Bronze"; ;BLANK()))) How can I find new customers in each month? I have thought to find them with a groupby for customerid with the

Testing DAX calculation with NBi

一个人想着一个人 提交于 2019-12-24 02:55:09
问题 I'm doing some research on automated test tool for our SSAS Tabular project. I found NBi and thought it is really cool. I attempted to set it up and successfully ran some basic tests. However, when I attempted to test dax calculation, it says "Function not found" (see screenshot). It sounds like it does not support SUM, but given that SUM is a basic function I would imagine it should work. Since I'm new to this tool, I wanted to double check if I've done something wrong or it is simply what

Difference between multiple dates in the same column based on category

ⅰ亾dé卋堺 提交于 2019-12-24 01:18:46
问题 I have the following problem .. I have this table: I want to create a calculated column that tells me the difference of days between two dates of the same code ( COD ), the difference should be calculated based on the date before the line. For example: Using COD B COD | DATE | days_diff B |05/01/2018 | B |09/01/2018 | 4 B |12/01/2018 | 3 In the example image the codes / dates are sorted in sequence, but in reality they are out of order. I tried to use the following sentence in DAX: DATEDIFF

Dynamic sum in dax picking distinct values

非 Y 不嫁゛ 提交于 2019-12-24 00:59:07
问题 Below is sample data Week Practice Type capacity Gen 1 BI c 80 0 1 BI c 80 1 1 BI sc 160 1 1 BI pc 240 0 1 BI pc 240 3 1 BI mc 1160 1 1 BI mc 1160 4 1 BI mc 1160 2 1 BI ac 440 1 1 BI d 40 0 1 BI d 40 3 I have a pivot chart, that has 3 slicers namely PRactice, Type, and gen. when I don't select any slicer, it should be a distinct sum(capacity) ie.,2120. Then when I click on type slicer say mc Sum(capacity) should be 1160 and click on only gen say 3 and clear other filters then sum(capacity) =

How to calculate rank within Sales ranges

牧云@^-^@ 提交于 2019-12-23 22:58:23
问题 How to calculate rank within Category defined on sales level. Say, that we want to label products with Sales above some threshold with Category "high", and below that threshold with Category "low". Here is a sample data. let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcisqzSwpVtJRSiwoyEkF0oZKsTpIwkmJeUAIZJigipfn56QlpRYVVQLZpqhSyRlQcWOweFhqempJYlJOKlgusagovwS7XEF+SWJJPtwJKHL5eZn5eUDaHNUqHI5GdkEsAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = (

Power BI - DAX Measure to calculate churned and reactivated customers in the current period. Incorrect total

五迷三道 提交于 2019-12-23 12:23:16
问题 Below is a simplified version of the data. Daily transaction list for customer ID SalesData = DATATABLE ( "Customer ID", INTEGER, "Date", DATETIME, "Amount", INTEGER, { { 101245, "2019/04/07", 500 }, { 101245, "2018/08/05", 400 }, { 100365, "2018/07/30", 900 }, { 100365, "2018/02/22", 700 }, { 104300, "2019/04/05", 300 }, { 104300, "2019/04/03", 350 }, { 104300, "2019/04/01", 310 }, { 107804, "2018/11/08", 650 }, { 107804, "2018/11/19", 640 }, { 108040, "2019/01/02", 730 } } ) Objective: