dax measure
43 TopicsCreate measure to calculate the difference in values between latest date and previous date
Hi everyone, I need some help. I've already tried different things, including asking LLM, but without any success, so I'm here to ask smarter people for help. I'm trying to create a measure that will give me the difference in a value for a specific entity between the latest date and the previous date. I have 2 tables. The first one contains the date and the entity name and the second one contains the value I want to measure. Both tables are related by a key column and the dates are not daily dates, but ad hoc dates. Something like this: The results I expect to see from the measure should look something like this: And I should be able to put the measure on a card and filter it by the entity name to display the related result. I have tried calculating the latest and previous date and then calculating the corresponding latest and previous value but when I ask to return the difference between latest and previous I never get those expected numbers... My guess is that I'm not using the right formulas to calculates the latest and previous values... Does anybody have an idea? Before anyone asks, I cannot change how the source tables look like as they are automatically generated by a third party software. Thanks in advance.Solved216Views0likes4CommentsSyntax error by adding conditions
I'm using this measure in PBI desktop which works fine: m_lan= sumx(values('vAbc'[ProjectID]),calculate(DISTINCTCOUNT('vAbc'[ID]))))) But I need to add two conditions and tried to change m_lan as below but getting this error: The following syntax error occurred during parsing: Invalid token, Line 3, Offset 3, . New measure(with line number): 1 m_lan = 2 var lan =CALCULATE( 3 DISTINCTCOUNT('vAbc'[ID]), 4 FILTER('vAbc', 5 'vAbc'[col1] <> "Hello" && 6 NOT(ISBLANK('vAbc'[col1])) 7 ) 8 ) 9 10 return SUMX(VALUES('vAbc'[ProjectID]), lan) I've tried to rewrite the measure in many ways but still getting error or wrong result. How can I add those conditions to the original measure? or why I getting this error?Solved1.4KViews0likes6CommentsShow latest value based on date and other criteria (measure or new column)
Hi, I am trying to create a measure or column that will allow me to easily bring the latest value into my visuals. Here is some example data; the highlighted column is what I'm trying to create. The end goal is to show the most recent sale as a flat line across a graph, so I can compare historical sales to the most recent one visually, by product. Also, the date needs to be dynamic so it automatically updates the values when fresh data is loaded. Thanks!Solved1.5KViews0likes2CommentsLast "non-blank" value in a "non-sorted" column
Dear community, In power bi I am using as an example a very simple table with 2 columns (date, value) and need a measure to collect the last non-blank value (0.65) for a card. Maybe I am wrong, but my understanding is that the LASTNONBLANK function works with a "sorted" column only. Is there any function in the Dax measure to identify the last non-blank value in an "non-sorted" column (such as in the value example) .. ? date value 01.01.2024 0.89 01.02.2024 1.34 01.03.2024 0.65 01.04.2024 01.05.2024 Appreciate your ideas and input. Many thanks .. Best TobySolved641Views0likes2CommentsDAX/Measure Support
Hi Experts, Need expertices support for below querry, currently i am link the Sharepoint list to Excel table then create some additional columns in Excel table and again creating new table for calculating the sum then linked the both tables to Power BI dashboard. Instead of creating multible tables in Excel, is there any solution for creating measure or something in DAX functions.Solved1.8KViews0likes4CommentsCalculate a value based on Department using a measure instead of calculated column
Hello, I've been trying to search this and figure it out but I can't seem to find the correct answer. I have two tables. (1) A list of Department (2) A table of all of our budgeted hire and open requisitions by department I need a count of Total Budget to Hire by department, as well as Total Open Requisition. Total Budget to Hire is determined by the sum of "Budgeted Positions" and IF Req Type = "Budget". Total Open Requisition is determined by the sum of "Number of Open Positions" and IF Req Type = "Open Requisition" How do I accomplish this using a measure instead of a calculated column? The output I need is below Thank you in advance!Solved867Views0likes3CommentsDAX Measure Question
Hi, First time poster, relatively new (but not brand new) to PowerBI. I am create a marketing dashboard for my company, and I am stuck on creating a measure that shows a count of new opportunities by region in the past 30 days. I have got the time filter right, and I didn't think I would need to put anything about the regions in the measure, but the results are telling me otherwise. So here are some details so that wiser minds can help me. The tables are Calendar (date : creation date) CRM Opportunity (organization : Org ID) CRM Region The Measure is: New Opps Last 30 Days = CALCULATE(COUNT('CRM Opportunity'[Opportunity Code]),FILTER(ALL('CRM Opportunity'),'CRM Opportunity'[Creation Date] >TODAY()-30 && 'CRM Opportunity'[Creation Date]<= TODAY())) When I put it in a table, as shown below, it's summing all the new opportunities in the last 30 days correctly, but not discerning any difference between the regions. In the details table, below that, you can see the break between Canada and Central. There are 21 opportunities for Canada, 20 for Central, etc. I assumed the table and the measure would work together, but clearly I'm wrong. Can anyone tell me what I'm doing wrong, and how to do this correctly? I'd really appreciate it! Thanks, KirstinSolved510Views0likes1CommentShow selected value from slicer when time intelligence slicer selected
Hi, I want to display selected value from the month and year slicer. However when time intelligence slicer(Calculation Group) selected other than 'Current Period' measure is not displaying anything because the time intelligence looking at multiple months when I select QTR, Year to Date etc., My measure: Test = "Reporting Period: " & SELECTEDVALUE('Date'[Month and Year]) I can't use the edit interactions as I need to show Period value as well in the measure. Any help is appreciated. Thanks482Views0likes1CommentHow to create a measure that will return 1 if everything is True and 0 if one is False
Hi Everyone, I've been trying to create a measure but hasn't been able to get the desired Output. Please see sample data sets: ID, Status, Create Date and True/False Column I want to validate if the Status of a particular ID had "Does Not Meet Minimum Qualifications" or FALSE then the count will be zero and 1 if everything is True. The results will be a distinct count and sum of the IDs without "Does Not Meet" or FALSE. Thank you 🙂Solved1.5KViews0likes2CommentsDAX measure for report tooltip
Hi, I am new to power BI and facing issues with a conditional tooltip. I have a combined table with all the data I need. (see sample data bellow). And I created a report gruoping the products by code and displaying the min, max and average unit price I want to be able to see the technical specification (could be one value or many) when I hover over the min or max values. I have been testing few dax code to create a measure and use in the tooltip, but I couldn't get it to work. Note that one code can have multiple technical specifications and unit costs, the logic I am using is e a condition combining the code and unit price to display the coresponding technical specifications. bellow is my latest attempt, that generates an error code (MdxScript(Model) (4, 1) Tooltip = VAR SelectedID = SELECTEDVALUE('Combined table'[code]) VAR SelectedValue = SELECTEDVALUE('Combined table'[Eur/Unit]) VAR Resulttable= CALCULATETABLE( 'Combined table', 'Combined table'[code] = SelectedID && 'Combined table'[Eur/Unit] = SelectedValue ) RETURN VALUES('Combined table'[Technical specification]) Thank you in advance Simo619Views0likes2Comments