dax command
29 TopicsIssue with Displaying All Days as Values from Calendar Table Using DAX Measure
Hi Everyone, I am facing an issue with the "Day" column from the calendar table. When using the following measure, only the day values are displayed from the column which as values from the fact table. However, I want all-day values to be shown from the column and I want the formula to show "zero" or leave the cell blank if there is no value for that day. Below is the measure I am using: DAX Formula: =DISTINCTCOUNT('_Orgination - Final_'[LoanId]) Note 1: There is a many-to-one relationship between the fact table and the calendar table, where the "many" side is the fact table and the "one" side is the calendar table. Note 2: The "Days[Row Label]" is from the calendar table. Note 3: I have tried several approaches but have not been able to achieve the desired result.Solved1.3KViews0likes7CommentsCreate a new table with columns from 2 separate tables using DAX
Hi Ive been trying to work out how to create a new table with 2 columns - column A from table 1 , column B from table 2. I want to create a custom table that just has the values I need, and I can modify any data as I need to without touching our main tables. I want to be able to drag any columns from the new table into a graph so I can build custom graphs without having measure or dimension incompatability. I tried using ALL but it has to be the same table. I'm frustrated as it just seems to be elusive to solve.....surely DAX isnt supposed to be this hard? If it was SQL i would have it done in 30 seconds Any help is much appreciated.Solved7.9KViews0likes7CommentsCompare data in same table based on column value
Hello, I am trying to mark any item that is not found earlier in the table as "Deleted " , but I want to ignore any data with value 3 or greater in my [entry] column. I am trying to add the [Deleted IDs] column below in green, but only want to label "deleted" to those with entry 2 if not found in group with entry 1. Thank you for any help on this! ID ENTRY Deleted IDs A 3 B 3 C 3 D 3 E 3 A 2 B 2 C 2 Deleted D 2 A 1 B 1 D 1Solved1KViews0likes5CommentsDAX to calculate total using prior calculated total based on category
Hi - I have below data in Table View and need a Dax formula to compute a column with the total based on prior week's computed number (prior total * factor) for each category: Category Date factor Total calculation A 01/01/24 - 100 A 01/08/24 1.01682 101.68 (100*1.01682) A 01/15/24 1.01734 103.45 (101.68*1.01734) A 01/22/24 1.01939 105.45 (103.45*1.01939) A 01/29/24 1.01854 107.41 (105.45*1.01854) B 01/01/24 1.01792 50 B 01/08/24 1.01612 50.81 B 01/15/24 1.01332 51.48 B 01/22/24 1.01134 52.07 B 01/29/24 1.01166 52.67Solved1.1KViews0likes5CommentsLooping and dynamically changing a table in DAX - The safety stock problem
Hello, Here is a hard problem (at least for me) in DAX that I am able to solve in VBA (xls) very easily with a loop. Unfortunetly loops are not very straighforward in DAX. I have parts leaving and arriving a warehouse. Parts can only leave (be sold) if the warehouse safety stock is at least 2 units. If the safety stock is not at least 2, the next part to leave will have to wait until a replacement part arrive. At the beginning of the month there is an expected schedule for arrivals and departures of the parts (see initial dataset) The question is, using DAX, how can I adjust the departure dates to make sure the safety stock is always kept? Here is how the problem looks like in an example : INITIAL DATA SET Date Type Safety Stock (after transaction) 1/1 Departing 3 1/2 Departing 2 1/4 Departing 1 (SO IT NEEDS TO WAIT) 1/5 Departing 0 (SO IT NEEDS TO WAIT) 1/6 Arriving 1 1/7 Arriving 2 I am looking to write a loop in DAX that would output the following (notice the 2 impossible departures have been move after each new arrival) FINAL DATA SET Date Type Safety Stock (after transaction) 1/1 Departing 3 1/2 Departing 2 1/6 Arriving 3 (ok 1 can leave) 1/6 Departing 2 1/7 Arriving 3 (ok another one can leave from the 2 that were previously impossible) 1/7 Departing 2 Is there a way to do that in a DAX Loop ? Thanks for reading.Solved1.3KViews0likes3CommentsSubject: How do I show an independent value of a subtask (hierarchy) in a matrix ?
Hello, I am trying to create a matrix where the rows are a set of tasks that need to be completed. The tasks have subtasks. Both the tasks and the subtasks have statuses (that are independent of one another, i.e. task 1 (level 1) can be in progress, but a subtask can be completed). The statuses (icons) are the values in the matrix. However, I do not know how to set up the excel sheet and/or the hierarchy, to show these independent statuses. Most hierarchy examples I have seen only talk about numerical data, but this is non numerical. Statuses include: Not Started, In Progress, Completed, At Risk, Delayed. Below is the example of the matrix. Here, the main task can have a different status as compared to the subtask's status. I know that ISINSCOPE needs to be used but do not know how to exactly resolve the issue. Can someone please help me write this code to achieve the end result? Any help would be appreciated. Thank you598Views0likes1CommentDAX SWITCH FORMULA SHOWING INCORRECT GROUPING
Hi, I'm trying to create a DAX formula using switch. I need to group all negative numbers to display no_new_return|prev rtn. However, some negative numbers are falling into other groups designated for positive values. Example -41 is falling in other groups such as 0-21,22-30 etc. as highlighted in the below image. The formula works for numbers > 0 but the negatives are not being recognized. Any assistance is appreciated. formula : ORD_RCPT_TENURE_GROUP = SWITCH(TRUE(),'FF_ORDER_MST'[ORD_RCPT_TENURE]<0,"NO_NEW_RTN | PREV RTN",'FF_ORDER_MST'[ORD_RCPT_TENURE]>=0 && 'FF_ORDER_MST'[ORD_RCPT_TENURE]<=21,"0-21",'FF_ORDER_MST'[ORD_RCPT_TENURE]>21 && 'FF_ORDER_MST'[ORD_RCPT_TENURE]<=30,"22-30",'FF_ORDER_MST'[ORD_RCPT_TENURE]>30 && 'FF_ORDER_MST'[ORD_RCPT_TENURE]<=60,"31-60",'FF_ORDER_MST'[ORD_RCPT_TENURE]>60 && 'FF_ORDER_MST'[ORD_RCPT_TENURE]<=90,"61-90",'FF_ORDER_MST'[ORD_RCPT_TENURE]>90 && 'FF_ORDER_MST'[ORD_RCPT_TENURE]<=120,"91-120",'FF_ORDER_MST'[ORD_RCPT_TENURE]>120 && 'FF_ORDER_MST'[ORD_RCPT_TENURE]<=180,"121-180",'FF_ORDER_MST'[ORD_RCPT_TENURE]>180 && 'FF_ORDER_MST'[ORD_RCPT_TENURE]<=365,"181-365",'FF_ORDER_MST'[ORD_RCPT_TENURE]>365,"+365","NO_NEW_RTN | PREV RTN")Solved1.1KViews0likes4CommentsHow to get current filter selected date in calculated column
Hi All, I have two tables, 1-DimDate 2-Services There is no relationship between them because for DimDate i am using date in Slicer to return only rows of Services which exist from and To dates, and it is working fine. The issue is in Services table i want to create one calculate column in which i want to return current selected date of slicer so that i can use it for further calculation. I am using below Dax but it is returning Blank. var selectedperiod = MONTH(SELECTEDVALUE(DimDate[Date])) return selectedperiod any clue for this?Solved748Views0likes1CommentQuerying Tables using DAX from Mutiple Cubes
Hi All, We have Multidimensionsal solution with multiple cubes in Databse. We have setup linked server to database programtically query the data. Can some one please tell how to specify the Cube Name while querying the Table using DAX. We want to use same LinkedServer Connection to query data from Muliple Cubes Example: select * from openquery(LinkedServerName,''EVALUATE CubeName.Table'')) If we specify the Cube Name then it's not working . With MDX , we have option to specify the Cube Name ( From Clause) while with DAX we didn't find option. Please tell how to provide the Cube Name while querying from DAX Thanks, Abhiram734Views0likes1Comment