dax

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.

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

Default filter in Power BI - Row Level Security not applied through LOOKUPVALUE

岁酱吖の 提交于 2019-12-22 09:57:25
问题 TL;DR: When using LOOKUPVALUE() against a table with Row Level Security, the RLS is not applied and all values are seen I have a requirement to have a 'default' value (location) picked in a Power BI report, based on the user. I am reporting against Azure Analysis Services (tabular model 1400) It appears that the way to implement default values in Power BI is to dynamically rename a value to something static, and pick that static value as a filter. So user Bob has default location Location1 so

Correlate Sequences of Independent Events - Calculate Time Intersection

青春壹個敷衍的年華 提交于 2019-12-21 20:50:53
问题 We are building a PowerBI reporting solution and I (well Stack) solved one problem and the business came up with a new reporting idea. Not sure of the best way to approach it as I know very little about PowerBI and the business seems to want quite complex reports. We have two sequences of events from separate data sources. They both contain independent events occurring to vehicles. One describes what location a vehicle is within - the other describes incident events which have a reason code

PowerBI DAX - Identifying first instance based on multiple criteria

久未见 提交于 2019-12-20 07:41:41
问题 Using DAX to identify first instance of a record I'm faced with trying to identify the first instance in a database where someone (identified by the ID column) has purchased a product for the first time. It's possible for said person to purchase the product multiple times on different days, or purchase different products on the same day. I drummed up an excel formula that gets me there, but am having trouble translating into DAX. =COUNTIFS(ID,ID,PurchaseDate,"<="&PurchaseDate,Product,Product)

How to make bar chart order values in DESC order after you choose value on another chart

天大地大妈咪最大 提交于 2019-12-20 04:58:33
问题 I have a Treemap chart that represents locations and bar charts that represents agents. When I click on one of the location I want agents be filtered in DESC order by money value. For example, I clicked on Modesto location and bar chart highlights particular people that are not in order. Any way not to display NOT highlighted values at all or bring them all the way on a bottom? I know that I can use the slicer with locations for that, but I want Treemap act as a filter in this situation. Is

DAX REMOVEFILTERS vs ALL

好久不见. 提交于 2019-12-20 03:57:09
问题 How to substitute REMOVEFILTERS in the following code with old school functions ALL and VALUES instead? This exercise is just to better understand REMOVEFILTERS. CALCULATETABLE ( -- get all products, in the modified filter context of... VALUES ( MyTable[product] ), -- no filter on product REMOVEFILTERS ( MyTable[product] ), -- and under the same parent category VALUES ( MyTable[Category] ) ) As far as I can read the hints here that could be possible. Here goes sample data: let Source = Table

Power BI - Find the % matching (Bounty 100) What-if analysis before and after

一个人想着一个人 提交于 2019-12-19 09:55:26
问题 I have a requirement where I have a table like this, Role Skills Developer C Developer SQL Developer C++ Data Analyst R Data Analyst Python Data Analyst SQL Business Analyst Excel Business Analyst SQL And I need to create something like this in Power BI, Explaining the first result for a Business Analyst in Power BI Visual Table, From Filter 1 - I have selected Data Analyst - whose actual skills are R, Python and SQL From Filter 2 - I have selected a new skill (Upskill) as Excel. So now, he

Return top value ordered by another column

北战南征 提交于 2019-12-17 10:01:59
问题 Suppose I have a table as follows: TableA = DATATABLE ( "Year", INTEGER, "Group", STRING, "Value", DOUBLE, { { 2015, "A", 2 }, { 2015, "B", 8 }, { 2016, "A", 9 }, { 2016, "B", 3 }, { 2016, "C", 7 }, { 2017, "B", 5 }, { 2018, "B", 6 }, { 2018, "D", 7 } } ) I want a measure that returns the top Group based on its Value that work inside or outside a Year filter context. That is, it can be used in a matrix visual like this (including the Total row): It's not hard to find the maximal value using

How to join tables on multiple columns in Power BI Desktop

南楼画角 提交于 2019-12-14 03:42:59
问题 The goal is to create a visual that shows Budget vs Premium for each month in a year; Something like that: So I have two tables BudgetData and Premiums. How can I join those two table on two columns: `BudgetData.InsurenceType = Premiums.Division and BudgetData .MonthYear = Premiums.MonthYear` BudgetDate Table: InsurType Amount MonthYear Commercial Auto 1000 Jan 2017 Commercial Auto 22000 Feb 2017 Commercial Auto 3000 Mar 2017 Specialty Casualty 4000 Jan 2017 Specialty Casualty 5000 Feb 2017