dax

DAX Last Year to Date

孤人 提交于 2019-12-13 02:54:34
问题 So I know this question has been asked a few times, and I've religiously looked over different approaches, however I still don't quite understand why I'm getting an incorrect result. Case: I have Sales Data from ~2016 -> 2019 (up until the 2/18/2019) I'm have a Measure to show me the YTD, however I'm looking for a measure for Last Years to date(the 18th in this particular circumstance). Right now, I have this: Total Sales LYTD = CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( FILTER ( VALUES

sorting stack bar chart in power BI

落花浮王杯 提交于 2019-12-13 01:48:07
问题 I am using a stacked bar chart for presenting the gender ratio in various region. here the legend is gender and Axis is region and value is headcount. when i want to sort the chart according to female gender value . the sorting is only done by the headcount value. how can i sort it for the percentage value. please help me. 回答1: EDIT: My first answer focused only on count, now I've taken into account that OP wants to sort by percentage female value You can sort your data directly in your

How do I filter results by a measure in Power BI

自闭症网瘾萝莉.ら 提交于 2019-12-12 18:44:28
问题 I need to be able to filter by a measure to show more granular results in Power BI. I would like to be able to choose where the percentage is in a range, or = 100% My calculation for the measure is this (each column can only be 1 or 0): errorPercentage = CALCULATE(SUM([missing data])/SUM([expected])) This works fine in the table and correctly shows the percentage which can be cut in many different ways. However, when adding a filter element/visual, Power BI wont let me use the errorPercentage

Power BI Rolling Average DAX to plot correctly on Column Chart

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 14:49:43
问题 I have a problem with the measure of the 3mth rolling average to visualise it correctly on the graph. The data model is here: https://docs.google.com/spreadsheets/d/1naChcuZtjSbk0pVEi1xKuTZhSY7Rpabc0OCbmxowQME/edit?usp=sharing I am using the formula below to calculate 3mth average through a measure: Product3Mth = CALCULATE(SUM('Table'[Product A uncum]);DATESINPERIOD('Table'[Date];LASTDATE('Table'[Date]);-3;MONTH))/3 When I am plotting it as a table it is showing right values for each month.

How to fill out blanks in Running Total matrix Power BI

前提是你 提交于 2019-12-12 14:30:26
问题 I am working on Loss Triangle in Power BI where AccidentYear are rows and DevYear are columns. The values in the table are Running Total created by measure: Running Total Loss = CALCULATE( SUM(fact_Losses[PaymentAmount]), FILTER(ALL(fact_Losses[DevYear]),fact_Losses[DevYear]<=MAX(fact_Losses[DevYear])) ) Link to get Raw data: https://www.dropbox.com/s/dvb6cu1k4vmzkur/ClaimsLloysddd.xlsx?dl=0 Running Total Cumulative Data looks like this: AccidentYear DevYear Running Total Loss 2012 12 164714

Visualizing last refresh date in power bi

。_饼干妹妹 提交于 2019-12-12 14:28:08
问题 Is it possible to add a card in power BI that shows the last time the underneath dataset has been updated? Many thanks! 回答1: You can create a blank query and use the following M query to create a single-cell table: let Source = #table(type table[Last Refresh=datetime], {{DateTime.LocalNow()}}) in Source And then you can use the Card visual and drag in the column to show it. You can rename the field to remove the default aggregation. (It doesn't matter since there is only one row of data

Power BI: How to dynamically change currency

試著忘記壹切 提交于 2019-12-12 13:09:36
问题 We have requirement to allow user to choose which currency he wants to see in the dashboard, like below example: By default, it's GBP , if user changes to USD , we need to show the spend by USD. Under the hood we already have table InvoiceDetail which contains columns doing currency conversion beforehand: SpendInGBP SpendInUSD SpendInEUR I am not sure how I can map when user chooses different currency using ChicletSlicer to different Columns. 回答1: If you have a table containing all formats

DAX Measure: dynamically consider only first for each group and and overall returns their count

…衆ロ難τιáo~ 提交于 2019-12-12 12:00:18
问题 We are struggling in trying to solve a problem that might simpler than I think. I am just stuck. The problem consists of defining a DAX Measure that dynamically counts only first visits in the period for each patient . Visits that are not first in the period must be assigned BLANK() value. Please before discussing the goal let me introduce the scenario. Scenario: We have a model composed of one fact table ( F_Visits ) and two dimensions ( D_Customer ; D_Calendar ). F_Visits has 1M records and

DAX - Running Total - Multiple Critiera + Grouping

孤人 提交于 2019-12-12 10:15:50
问题 I've looked everywhere for this but any other example is not exactly what I want to achieve. I have data that looks like that: Day Group Sales 14 1 15 13 0 22 14 1 17 and so on. Now I create calculated field of Running Total using following formula: CALCULATE ( SUM(Table[Sales]), FILTER ( ALL (table), Table[Date] <= MAX(Table[Date]) ) ) I create Pivot Table and put Date and Group as rows, then Running Total as Values. Why running total is not aggregated separately for each group? I would like

DAX percentiles of sums

隐身守侯 提交于 2019-12-12 04:56:22
问题 I have a table with the following fields: [Date] [Ref Nr] [Units] I'd like to do a SUM over [Units] for each value in [Date] and [Ref Nr] and then take a 80 percentile for each value in [Ref Nr]. I've tried the following but it doesn't work... DEFINE MEASURE 'Table'[Pctl] = CALCULATE( PERCENTILEX.INC( 'Table', CALCULATE( SUM('Table'[Units]), ALLEXCEPT('Table', 'Table'[Date], 'Table'[Ref Nr] ) ), 0.8 ), ALLEXCEPT('Table', 'Table'[Ref Nr] ) ) EVALUATE FILTER( SUMMARIZE( 'Table', 'Table'[Ref Nr]