"dax help" dax
29 TopicsHow to subtract one more month to DATEDIFF result (only if total is 0 or greater than 0)?
I have following measure: ForecastMonths = DATEDIFF( FIRSTDATE ('Table'[Survey Date]), LASTDATE ('Calendar'[Month Year]), MONTH ) I am trying to adjust the result (which comes in number of month) to one more/less month. I would like the result to be either 91 or 89. How do I go about doing it? Thanks for help.Solved1.3KViews0likes5CommentsDAX calculated measure only working in a specific row before any FILTER is applied
Hi, I have been unable to figure out the following issue: I cannot calculate measures in my total (calculated) rows (i.e Total = Measure 1 + Measure 2) of my Expense statement Layout template because Measure 1 (or Measure 2) is only calculated in it's own row and the Total row stays blanks (See Screenshot#1). The measure calculations do not work when I use my RM Expense Layout table (using formula #1 or #2) The measure calculations work if I use the (sub)header column (Group Level 2 (CALC) from my CC Mapping Table (equivalent to a Chart of Accounts) with Formula #1 My question is: How can I make the result in screenshot #2 work with my RM Expense Layout table? Why are the measures only working as inteded with the [GROUP Level 2 (CALC)] column table layout? Below, shows the relationships between my tables Formula #1: NFRM = CALCULATE( SUM('06. Hyperion Data (GL)'[Amount]), '03. CC Mapping'[Group Level 2 (CALC)]="Non-Financial Risk." ) Formula #2: SUM('06. Hyperion Data (GL)'[Amount]), '05. RM Expense Layout'[RM Expense Layout]="Non-Financial Risk." ) Screenshot #1: The calculated the NFRM measure only works for the header that matches the text in Group Level 2 (CALC) column (CC Mapping table) or the text from the RM Exp Layout column in the RM Expense Layout table. Screenshot #2: Measure works in all the rows before any filter is applied. With formula #2, calculation only happens in Non-Financial Risk row.Solved1.7KViews0likes10CommentsDynamic name
CurrentMonthLastYearCount = VAR SelectedMonth = MAX(Query1[SetupDate]) VAR LastYearSameMonthStart = EOMONTH(SelectedMonth, -13) + 1 VAR LastYearSameMonthEnd = EOMONTH(SelectedMonth, -12) VAR Result = CALCULATE( SUM(Query1[NewCount]), Query1[SetupDate] >= LastYearSameMonthStart && Query1[SetupDate] <= LastYearSameMonthEnd ) RETURN Result I am using this DAX however i want the name to be dynamic based on slicer selection. E.g. if i select feb 2025, it should show feb 2024.Solved1.4KViews0likes7Commentshow can use measures for comperision in conditional formatting using power bi
I made two measures to find the sales amount for this day and the previous day. Now, I want to make a comparison between the amounts. I want to use an up arrow icon and a down arrow icon to show me which value is higher than the other. I mean like this I tried to use conditional formatting, but it is difficult to add a measure for comparison." what sould i do ?SolvedNeed help on Sequence number in same column and Horizontal records in same row
Hi All, Please find the below screenshot of sample data, need help on the "Horizontal records" in a same row and "Sequence number" for different Insureds numbers. Sample Data: Below are the requirements need to work on the DAX calculated column: "Upload ID", "Policyholder Name" and "InsuredS". Please help. Requirement: 1. Under "UploadId" and "Policyholder Name" In case multiple values are present for a single Application Number, list all items need to display horizontally, separated by a space. Maximum of 20 characters allowed, in case this limit will be exceeded display "..." at the end 2. For "Insured Branch Number" new calculated column display a sequence of numbers starting from "1" in case multiple insureds are present within the policy Expected OUTPUT: Here is the OUTPUT need to display in Power BI with the help of sample data. Please help. Sample Data Reocrds: Here is the sample records can work for this expected OUTPUT. Policy Product Type Application Number Image Upload Date and Time Upload ID Policyholder Client ID Policyholder Name InsuredS 9000123 GH 30330330311 2024/7/03 13:00:02 bheemvi 7185244885 bheemvi 8541224151 1236121 RT 77879174306 2024/7/03 13:00:02 surfati 5535470245 surfati 7563424173 3954848 MM 40760081519 2024/7/03 13:29:30 kudou 7128024728 kudou 5535470245 3954848 MM 40760081519 2024/7/03 13:29:30 raju 7128024728 raju 9641540351 3954848 MM 40760081519 2024/7/03 13:29:30 venky 7128024728 venky 8541224151 6864730 CN 40510010297 2024/7/03 14:02:99 suresh 8541224151 suresh 7563424173 9000520 BO 40760081311 2024/7/03 14:02:99 naresh 7563424173 naresh 5535470245 1236121 RT 77879174306 2024/7/03 15:00:02 gopal 5535470245 surfati 9873424173Solved704Views0likes2CommentsFind Last Value by MAX date and SUM
I have an inventory audit table. I created a measure to find the qty of the last record date for each warehouse and bin, however the grand total is showing 0 but I want it to SUM that measure. For the example below, I want the grand total to show 37. Qty Last Value = CALCULATE(SELECTEDVALUE('Inventory Audit By Date'[Qty On Hand]), 'Inventory Audit By Date'[Date] = MAX('Inventory Audit By Date'[Date])) *Date Max is also a measure Date MAX = MAX('Inventory Audit By Date'[Date])Solved906Views0likes3CommentsCount person who are joining and leaving
Hi. Seeking for your help regarding DAX. I want to create a DAX that counts the people who join and leave the online event. I have created a visual that counts who joins in a specific hour. However, I wish to make a visual that adds the people to the count who join the online event and subtracts the number of people who leave in an hourly interval. Below is the sample data Name start_time end_time duration (seconds) Duration (Minutes) Duration (Hour) PERSON_1131 12/03/2024 6:48:55 am 12/03/2024 6:48:56 am 1 0 0 PERSON_1282 12/03/2024 6:49:10 am 12/03/2024 6:49:19 am 9 0.2 0 PERSON_1320 12/03/2024 6:49:26 am 12/03/2024 6:49:34 am 8 0.1 0 PERSON_1326 12/03/2024 6:50:57 am 12/03/2024 6:51:06 am 49 0.8 0 PERSON_1107 12/03/2024 6:53:47 am 12/03/2024 6:53:53 am 6 0.1 0 PERSON_1076 12/03/2024 6:58:49 am 12/03/2024 6:58:51 am 2 0 0 PERSON_1004 12/03/2024 6:49:12 am 12/03/2024 6:59:40 am 1028 17.1 0.3 PERSON_1217 12/03/2024 7:00:39 am 12/03/2024 7:00:44 am 5 0.1 0 PERSON_1298 12/03/2024 7:00:24 am 12/03/2024 7:00:44 am 20 0.3 0 PERSON_1217 12/03/2024 7:00:56 am 12/03/2024 7:00:59 am 3 0 0 PERSON_1426 12/03/2024 6:50:25 am 12/03/2024 7:01:00 am 5075 84.6 1.4 PERSON_1326 12/03/2024 6:51:14 am 12/03/2024 7:01:07 am 4993 83.2 1.4 PERSON_1081 12/03/2024 7:01:20 am 12/03/2024 7:01:23 am 3 0 0 PERSON_1426 12/03/2024 7:01:21 am 12/03/2024 7:01:24 am 3 0 0 PERSON_1326 12/03/2024 7:01:12 am 12/03/2024 7:01:57 am 45 0.8 0 PERSON_1130 12/03/2024 7:02:05 am 12/03/2024 7:02:08 am 3 0 0 PERSON_1006 12/03/2024 7:02:13 am 12/03/2024 7:02:14 am 1 0 0 PERSON_1068 12/03/2024 7:00:54 am 12/03/2024 7:02:18 am 164 2.7 0 PERSON_1231 12/03/2024 7:02:32 am 12/03/2024 7:02:35 am 3 0 0 PERSON_1076 12/03/2024 7:02:42 am 12/03/2024 7:02:44 am 2 0 0 PERSON_1060 12/03/2024 7:02:50 am 12/03/2024 7:02:51 am 1 0 0 PERSON_1147 12/03/2024 7:02:19 am 12/03/2024 7:02:55 am 36 0.6 0 PERSON_1210 12/03/2024 7:03:19 am 12/03/2024 7:03:20 am 1 0 0 PERSON_1564 12/03/2024 7:02:51 am 12/03/2024 7:03:26 am 75 1.2 0 PERSON_1581 12/03/2024 7:01:39 am 12/03/2024 7:03:36 am 197 3.3 0.1 PERSON_1051 12/03/2024 7:03:34 am 12/03/2024 7:03:48 am 14 0.2 0 PERSON_1074 12/03/2024 7:04:29 am 12/03/2024 7:04:31 am 2 0 0633Views0likes1CommentHow to lookup and compare data in the same table
Hello, I need help with adding a new column. Is there a way to lookup values/compare data in the same table? I have schedule data that will be added to the table for each month. Most values in the ID column will repeat each month, and there will be some IDs that are removed or added. I am trying to add a new column to the same table that shows the status of the previous month. Columns Status and Schedule Status are calculated columns with Dax. Any help to put me in the right directions is useful. ID Status Schedule Status Previous Status ABC On time Previous DEF Not on Time Previous GHI Future Previous JKL On time Previous ABC On time Current On time DEF On time Current Not on Time GHI On time Current Future JKL On time Current On time MNO On time Current AddedSolved808Views0likes2CommentsNeed help with the DAX Calculation
Hi Team, I have a sample file. (I'm unable to attach the file over here but I can share) Based on the data, the output generated by the below dax for "Average Lead Time" is 16. Average Lead Time = CALCULATE(MAX(Sheet2[LEAD_TIME_NR]), FILTER(ALLSELECTED(Sheet2[LEAD_TIME_NR]),[1 % Of Arrivals Running Total] >= 0.8 && [1 Previous Cumulative] < 0.8) ) Other Dax used: 1 % Of Arrivals Running Total = CALCULATE( [1 % Of Arrivals], FILTER( ALLSELECTED('Sheet2'[LEAD_TIME_NR]), ISONORAFTER('Sheet2'[LEAD_TIME_NR], MAX('Sheet2'[LEAD_TIME_NR]), DESC) ) ) 1 Previous Cumulative = [1 % Of Arrivals Running Total] - [1 % Of Arrivals] 1 % Of Arrivals = divide([Stay Number of Arrivals], [1 Total Arrivals]) Stay Number of Arrivals:= CALCULATE(sum(Sheet2[ROOMS_OCC_NR]), FILTER(Sheet2, Sheet2[ARRIVAL_IND] = "Y")) 1 Total Arrivals = CALCULATE(sum(Sheet2[ROOMS_OCC_NR]), all(Sheet2[LEAD_TIME_NR]), Sheet2[ARRIVAL_IND] = "Y") I tried but unable to break the logic in the dax. Please if someone could help me would be greatly appreciated. Many Thanks, MithileshSolved1.7KViews0likes9CommentsDAX calculate Previous month lost customer revenue
Hi guys, I am having trouble calculating the previous month lost customer revenue. My model relies on a single way relationship between thr fact table and the time table, so that is not possible to change. I would like to display the measure "Churn_lost_$" as shown in the picture below. Thank you very much! 🤙 You can donload the model here: https://drive.google.com/file/d/1MKFmtBIm1Z-yJ0--FhVRuIrZqWVV166c/view?usp=sharing1.6KViews0likes9Comments