dax

Filter a column dynamically using a measure in Power BI

∥☆過路亽.° 提交于 2019-12-14 03:08:49
问题 There is a column with FY i.e. "FY19","FY18","FY17" etc. I Created a measure which calculates the current FY: CurrFY = CONCATENATE ( "FY", IF ( MONTH ( TODAY () ) <= 3, VALUE ( FORMAT ( TODAY (), "YY" ) ), VALUE ( FORMAT ( TODAY (), "YY" ) ) + 1 ) ) e.g. output: "FY19" Now i need to filter the report based on the FY column using the current FY i get from the CurrFY measure. How do i do it? 回答1: Create a calculated column on your table using that measure FYFilter = IF(Table1[FY] = [CurrFY], 1,

DAX Measure to calculate aggregate data, but group by Case ID

蹲街弑〆低调 提交于 2019-12-14 03:02:49
问题 So I have a variable var varSubItem = CALCULATE (MAX(Outages[SubItem]), Outages[DATE] >= DATE(2019, 07, 14) ) to calculate out items that have had an outage within 1 day. See below. Then I have another variable var data = CALCULATE ( COUNT ( Outages[CASE_ID] ), ALLSELECTED ( Outages ), Outages[SubItem] = devices ) which gives me back the outage count for the devices in the last 2 years. It's only the last two years because my table visual has a filter for that time frame. I pray that I'm

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

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

Calculate Event Durations to only part within Sliced Period

白昼怎懂夜的黑 提交于 2019-12-13 07:30:09
问题 We are investigating PowerBI for a reporting solution and it does a lot of what we need. However we need to be able to do adhoc reporting on events. Each event has a start date and an end date and total seconds and do percentage calculations etc. This works really well. However our common requirement is to specify a start date and end date of which we wish to consider data. Many of the events will span over start and end of required period or even start before the start of period and go

Power BI DAX Calculating Last week Sales for All the Filter Options

不羁岁月 提交于 2019-12-13 07:04:10
问题 I have following Data Structure Date | Category | Sales Amount ---------------------------------------------------- 01-Sep-2016 | Food | 100 02-Sep-2016 | Food | 120 03-Sep-2016 | Food | 130 01-Sep-2016 | Electricity | 180 02-Sep-2016 | Electricity | 60 01-Sep-2016 | Perfumes | 80 02-Sep-2016 | Perfumes | 40 I want to calculate the Two Week Sales for Each Category, I might add another column like Territory as well in the future. I used following Formula which worked fine if I only select Date

Display Count of Users based on Multiple slicer values Power BI

我们两清 提交于 2019-12-13 03:25:25
问题 I am working on a Viewership table which tells numbers of customers watches asset. There are two asset filters. One for watched and one for not Watched. Based on the asset filters, I need to display number of customers who watched the show & customers who didn't watched the show. Below is the method I have used. First, created a new table "Asset": This table contains unique assets and used it to create a slicers that affects DAX measure but does not affect the visual (table). Asset table

How to sum multiple duration values that sum to greater than 24 hours in PowerBI

霸气de小男生 提交于 2019-12-13 03:21:08
问题 How do I sum multiple duration values (different people working in one day) when the results will be greater than 24 hours (e.g. 125:23:33) in a measure. For example these are some duration values to add: 13:33:55 20:44:23 15:31:11 回答1: You will need to create a "New Quick Measure" column with the dax code below: SumDuration = VAR TotalSeconds=SUMX('MyTable',HOUR('MyTable'[duration])*3600+MINUTE('MyTable'[duration])*60+SECOND('MyTable'[duration])) VAR Days =TRUNC(TotalSeconds/3600/24) VAR

DAX - Bring back all records from a team where the logged in user is in the team

独自空忆成欢 提交于 2019-12-13 03:07:32
问题 I have Row Level Security applied in Dynamics CRM for Power BI embedded. The logged in user only sees their data and now I'd like for them to see all teams data that the logged in user is part of. Bring back all team data that Lucy appears in: Logged in user: Lucy Username: user1 TEAM A Record 1 (Lucy) Record 2 (Bob) Record 3 (Lucy) TEAM B Record 4 (Lucy) Record 5 (Kate) Record 6 (Paul) TEAM C Record 7 (Lucy) Record 8 (Bill) Team D Record 9 (John) Record 10 (Jane) The DAX should bring back