variable
16 TopicsDebug DAX measure variables incl. virtual tables
Hi, I created an idea to be able to visually inspect the variables of a DAX measure, when the DAX measure is used in a table visual, line chart visual, etc. Please vote 😀 https://ideas.fabric.microsoft.com/ideas/idea/?ideaid=a7a31361-2f40-ef11-b4ac-6045bdbf86b41.2KViews0likes2CommentsTransforming a Calculated Column into a Variable inside a Measure
I have the following Calculated column to figure out if which rows hold the latest versions of data MaxDate = CALCULATE(MAX(ProjectsTable[Metric Date]),FILTER(ProjectsTable, Projects[Project Name]=EARLIER(ProjectsProject Name]))) Followed by this second calculated column which acts as a Flag LatestValue = If(ProjectTable[Metric Date] = ProjectTable[MaxDate], 1, 0) Ultimately I'm trying to fit both of these inside a Measure as variables so the result can be dynamically filtered. My problem is that the first column is a formula that doesn't work inside a measure. I'm getting errors with it. I tried playing around with it with something like this but to no avail Var FilterDate = MAX(ProjectTable'[Metric Date]) Var LastUpdate = CALCULATE( IF(MAX(Project Table[Metric Date]) <= FilterDate, 1, 0), VALUES(ProjectTable[Project Name])) Note, the VALUES is because I need to filter latest date per Project name (different projects have different latest dates). Thanks for any help!Solved824Views0likes1CommentData Pipeline - DataFlow Gen 2, Variables assignment
1. I have a dataflow in Data Factory to which I applied some transformations such as 'Unpivot Columns' and 'Group By'. I want to create a pipeline which ensures that new data gets added in my dataflow automatically and any transformation such as 'unpiviot' or 'group by' that I applied to my dataflow earlier gets applied to the new data that is added. 2. I have a question regarding the 'Variable' feature in Data Pipeline. I created a pipeline wherein I have dataflow gen 2 as first activity and on success of that activity, I want to assign my dataflow a variable. The pipeline runs successfully but I do not see anything in the output.'Solved4.9KViews0likes9CommentsRating system not giving me a total
I'm looking to create a rating system that will display the overall health of a division example; anything greater than 80% is 1 point, 50% - 79% will be .5 points, 49% and less is 0 points. i created the following dax which was able to give me the correct values, but i was not able to get the table to calculate a total, its giving me an average Overall point = VAR _Claims = SWITCH( TRUE(), [% of Claims Assigned] >= .80, 1, [% of Claims Assigned] >= .60 , .5, 0 ) VAR _Risk = SWITCH( TRUE(), [% of Risk Assigned] >= .80, 1, [% of Risk Assigned] >= .60 , .5, 0 ) VAR _Casualty = SWITCH( TRUE(), [% of Casualty Assigned] >= .80, 1, [% of Casualty Assigned] >= .60 , .5, 0 ) VAR _Property = SWITCH( TRUE(), [% of Property Assigned] >= .80, 1, [% of Property Assigned] >= .60 , .5, 0 ) VAR _Primary = SWITCH( TRUE(), [% of Primary Assigned] >= .80, 1, [% of Primary Assigned] >= .60 , .5, 0 ) VAR _Cyber = SWITCH( TRUE(), [% of Cyber Assigned] >= .80, 1, [% of Cyber Assigned] >= .60 , .5, 0 ) VAR _Total = CALCULATE(_Claims + _Risk + _Casualty + _Property + _Primary +_Cyber) RETURN _Claims + _Risk + _Casualty + _Property + _Primary +_Cyber Expected visual the total is 32.5 current visual is giving an averageSolved974Views0likes3CommentsPass slicer date range to a variable
I am having trouble passing a slicer date range to a variable. I have two tables: 1. Before_Day_Key is used for my before slicer 2. After_Day_Key is used for my after slicer I have created variables that create the min and mix date for each of the slicers. Now I want to create a variable that has the date range of each slicer. What I am expecting is: VAR _periodBefore: 01/17/2023 - 03/20/2023 VAR _periodAfter: 03/28/2023 - 05/29/2023 Before_Day_Key table is here. After_Day_Key table is here. Can you help complete the statement: PED2 = VAR _minDateBefore = MIN('Before_Day_Key'[Business Date]) VAR _maxDateBefore = MAX('Before_Day_Key'[Business Date]) VAR _minDateAfter = MIN('After_Day_Key'[Business Date]) VAR _maxDateAfter = MAX('After_Day_Key'[Business Date]) VAR _periodBefore = VAR _periodAfter =Solved2.2KViews0likes6CommentsVisualize one variable twice but with different filters
Hi everyone, I want to illustrate the number of beneficiaries of different interventions (1-5). I have one variable that equals the total number of beneficiaries, and I would like to visualize the number of beneficiaries of intervention 1 in the same graph (e.g. bar chart) as the number of beneficiaries of intervention 2, 3 and so on. To get the correct values I can select the interventions respectively as a filter on the beneficiaries variable, but I can only insert this variable of total beneficiaries once per graph. How can I visualize the same variable but with different filters on in the same graph? Thanks!708Views0likes1CommentSum for last days of month per each category - how to simplify
Hello, I have a quite peculiar problem. I have a column with values that represents the state of Inventory for each Site (category). Which means that the most recent one value for each month is always last day per each site per month. Example for site 667 for november its going to be value 5 252 235.74 (31/12/2021) but for site 200 its going to be 79 967 894.18 (30/12/2021) The sum of those values should be 85 220 129.92 which is state of inventory for those two sites per december. I was able to calculate this with this measure: Inventory Cost = VAR _pretable = ADDCOLUMNS ( SUMMARIZE ( v_factinventorytransactions, v_dimdate[DateId], v_factinventorytransactions[SiteId] ), "InventoryCost", CALCULATE ( AVERAGE ( v_factinventorytransactions[RunningCost] ) ) ) VAR _table = FILTER ( _pretable, VAR _MaxDate = CALCULATE ( MAX ( v_factinventorytransactions[InventoryTransactionDateId] ), ALLSELECTED ( v_dimdate[DateId] ) ) RETURN v_dimdate[DateId] = _MaxDate ) RETURN SUMX ( _table, [InventoryCost] ) Which works perfectly but I'm wondering if it can be simplyfied. I want it to simplify, because when I want to use this measure inside another one that sums those Inventory Cost values per month for last 3 months and I have wrong answers. Which means that this Inventory Cost measure works but if I call out this measure in the one below it shows wrong numbers (but other measures, more simply ones work). Rolling3Months = VAR _EndDate = MAX(v_dimdate[Date]) VAR _Dates = DATESINPERIOD(v_dimdate[Date], _EndDate, -3, MONTH) VAR _Cost = [Inventory Cost] VAR _Inventory = SUMX(_Dates, CALCULATE(_Cost, ALL(v_dimdate[YearMonth]))) RETURN _Inventory I'm a little bit stuck and would be super appreciated when someone would pointed out my mistakes/errors here. I'm also providing sample power BI file with those. https://we.tl/t-eQSOYHm1ft Thank youSolved481Views0likes1Comment