powerpivot

Cumulative distinct count filtered by last value - DAX

▼魔方 西西 提交于 2019-12-23 03:13:12
问题 I have a dataset: month name flag 1 abc TRUE 2 xyz TRUE 3 abc TRUE 4 xyz TRUE 5 abc FALSE 6 abc FALSE I want to calculate month-cumulative distinct count of 'name' filtered by last 'flag' value (TRUE). I.e. I want to have a result: month count 1 1 2 2 3 2 4 2 5 1 6 1 In months 5 and 6 'abc' should be excluded because the flag switched to 'FALSE' in month 5. I am trying to achieve something using examples given here: http://www.daxpatterns.com/cumulative-total/ . But I am struggling terribly.

MDX syntax for DAX measures calculated with AVERAGE()

你离开我真会死。 提交于 2019-12-22 17:23:05
问题 I have the following expression in Excel that works fine. =CUBESET("ThisWorkbookDataModel", "TopCount( [ProductBV].[Product Name].Children,10, sum( ( [Calendar].[Week Ending].[All].[1/6/2013]:[Calendar].[Week Ending].[All].["&TEXT($E$2,"m/d/yyyy")&"], [ProductBV].[Moderation Status (ALL)].[All].["&$E$3&"] ), [Measures].[Product Review Count] ) )", "Top 10 to date") The Product Review Count measure using the following DAX formula. Product Review Count:=COUNTROWS(ProductBV) However, when I

CALCULATE with OR condition in two tables

非 Y 不嫁゛ 提交于 2019-12-22 11:29:32
问题 In order to Sum the sales amount of blue products OR products that belong to category shoes, I'm using the following DAX expression: CALCULATE( SUM(Table[SalesAmount]), FILTER( Table, Table[Color] = "Blue" || Table[Category] = "Shoes") ) However, this doesn't work with two different tables (Colors and Categories), like: CALCULATE( SUM(Table[SalesAmount]), FILTER( Table, Colors[Color] = "Blue" || Categories[Category] = "Shoes") ) Can anyone help? Thanks! 回答1: Searching the web led me to this

VBA code to filter a pivot table based on the value in a Cell

こ雲淡風輕ζ 提交于 2019-12-20 07:40:34
问题 I’ve searched and tried everything I could find on how to filter a pivot table via VBA code referencing the value of a cell. The table only has one filter and it’s called “name”, this table is part of a score card that I’m putting together and the pivot itself is named “data” the sheet is named “report” and the cell I’m referencing is A5. I’m able to do simple things in VBA and have been using it here and there for a couple of years however this one thing has me pulling my hair out. Could

PowerPivot Slicer selection based on cell value using VBA

亡梦爱人 提交于 2019-12-20 06:37:04
问题 I'm having some issues in automating a PowerPivot slicer using vba. What I am trying to do is have the slicer update and only select what is in a certain cell. So for example assuming the cell was J3 then whatever was typed in J3 that's what would get updated in the slicer. My values in my slicer are just numbers. The code I currently have (which doesn't work) throws a run time error is below. The formula name of the slicer is "Syndicatenumber" and the cell I would like it to look at and then

Connecting to PowerPivot with C#

只愿长相守 提交于 2019-12-18 11:13:46
问题 Is it possible to connect to a PowerPivot model in an Excel .xlsx file? (Not hosted on a SharePoint site... just the local file). It must be, since Tableau can do it. Anyone have any clues? 回答1: Short answer: Yes Long answer: Updated versions of either Excel or PP (maybe even Office service packs?) could break your code We were successful in connecting to the PP model using AMO (to add tables to the data source view, add dimensions, add measures, and refresh the model from external DBs). We

Individual start date per month

和自甴很熟 提交于 2019-12-13 23:04:31
问题 together how do I get it in PowerPivot or as Dax formula out that for my internal / individual months the beginning of the month from 31.120.2018 for January 2019 receive? So, that I get the January in the PowerPivot calendar table already from 31.12.2018 and then in the 4-4-5 weeks cycle? So 31.12.2018 + 28 days = January 31.12.2018 + (28 days * 2) = February 31.12.2018 + (28 days * 2) + 7 days = March Does anyone have an idea? Best Regards 回答1: First I create a calendar table, this is the

PowerPivot Calculate filters wont work

此生再无相见时 提交于 2019-12-13 21:12:15
问题 I have the following tables Orders: OrderID|Cost|Quarter|User ------------------------- 1 | 10 | 1 | 1 2 | 15 | 1 | 2 3 | 3 | 2 | 1 4 | 5 | 3 | 3 5 | 8 | 4 | 2 6 | 9 | 2 | 3 7 | 6 | 3 | 3 Goals: UserID|Name |Goal|Quarter|Sum ----------------------------- 1 |John | 20 | 1 | x 1 |John | 15 | 2 | x 2 |Bob | 12 | 2 | x 2 |Bob | 15 | 3 | x 3 |Homer| 5 | 3 | x 3 |Homer| 7 | 4 | x Now what I want to do is in the second table sum up all orders that have the UserID from the current row and are in the

Rolling/Moving average by month over years

孤街浪徒 提交于 2019-12-13 18:42:27
问题 Looking to get a moving average and aggregate sum over years by specific months over 3 years, not monthly rolling average. I want to see how our business trends by month over the years and want to have the average as a baseline. ie: January 2011, January 2012, January 2013, etc February 2011, February 2012, February 2013, etc So far all I have been able to do is get a 3 year SUM from selected year, and even that is off. Ex: selected month = Jan 2013, aggregate includes all months from

Customers who bought and not bought some product in last 90 days

烂漫一生 提交于 2019-12-13 08:10:52
问题 I need a dax measure which shows me which customers bought products B and C in last 90 days. And another one which shows me those whose bought products B and C in last 90 days. (based in my filter date context) Below is like it should be: Can someone help me? Here is a sample data if needed: FactSales KeyDate KeyCustomer KeyProduct Total 1 1 1 12,9 1 2 2 13 1 3 1 156,4 1 4 1 564,8 2 1 1 894,8 2 2 1 56,5 3 1 2 564,85 3 2 3 564,8 4 1 1 1325,6 4 2 1 132,3 Customer KeyCustomer Name 1 Jean 2 Mari