need help with dax
18 TopicsQuick question about SUMX
I am trying to understand about SUMX. I have uploaded my PBIX file here for reference. I have a measure called "Sumx", and its code looks like this: Sumx = SUMX( VALUES('Date'[DateFormat]), // Table CALCULATE ( DISTINCTCOUNT([ClientID]) // Expression? ) ) By definition, it "returns the sum of an expression evaluated for each for in a table". But why do we have table here 'Date'[DateFormat] which counts 1,336 rows? What is use of this? What is point VALUES('Date'[DateFormat]) in this case? Thanks.Solved1.6KViews0likes7CommentsSimple question on DAX
I have following DAX that I have been using but I was wondering about this for a long time. DAX = IF( HASONEVALUE( tblTest[Name]), var CurrentTestValue = SELECTEDVALUE( tblTest[Field]) return CALCULATE( SELECTEDVALUE( tblMain[Rating]), TOPN(1, FILTER( ALL( tblMain ), CurrentTestValue <= tblMain[CutOff] ), tblMain[MaxTotal], ASC ), All(tblMain) ) ) My question is: 1) What is point of All(tblMain)? I know that it would not make a difference if that part is there or not.Solved920Views0likes3CommentsVery high total table results, does not average.
HELP PLEASE! Hello, I have a problem that I have been looking for the solution for several days but I can't find it. I would be very grateful if someone could help me, because it is something that I will have to use a lot and I have no way to solve it. I have a table with data, in which when I make the comparison to see the % that we have gone up or down with respect to last year gives me very high results. When I do the comparison by date I get the total result very high, but when I do it by week and month I get all the results very high, both the total and the partial results. What I want is that the total result (like the weekly and monthly ones) gives me the average of all the results that compose it, and it is impossible that these very high numbers that I get are averages. I leave here below the images in which you can see my case. I am also going to leave the formula that I am using for it, since I believe that the solution may be that the dax formula that I am using is wrong. The formula is the following: R_LYDay(B) = VAR _actual_total = SUMX( VALUES(calendar_table[Date]), SUM(R) ) VAR _LY_total = SUMX( VALUES(calendar_table[Date]), CALCULATE( SUM(R), DATEADD(calendar_table[Date], -364, DAY) ) ) RETURN DIVIDE(_actual_total - _LY_total, _LY_total, 0) When I put “R” is where the main measurement is, but for confidentiality I prefer not to share. I would be very grateful if someone could give me a solution. Thank you very much in advance.Solved815Views0likes4CommentsHow to modify this to show all values when filter selects ALL (Part 2)
I have posted this question about a week ago, and I thought my manager said "it is good" back then, but yesterday I heard that I need to come up with a solution as below: Here is my latest PBIX file. But, now bottom is requirement: This is my previous post , and with following DAX code, I thought it would satisify the requirement from my manager: ALI1 = IF ( ISFILTERED ( 'Z-Table'[Location] ), IF ( CONTAINSSTRING ( CONCATENATEX ( 'Z-Table', 'Z-Table'[Location], "," ), "ALI" ), "ALI", "" ), "" ) FILTER = IF ( ISFILTERED ( 'Z-Table'[Location] ), IF ( MAX ( 'tblScore'[Location] ) IN VALUES ( 'Z-Table'[Location] ), 1, 0 ), 0 ) Basically, current DAX works if user selects each selection one by one, but not when selected "Select all". So, I want those characters ("ALI", "ARB" & "AVI") show up when selected individually as well as selected "Select all". Is it possible? Thanks.Solved817Views0likes3CommentsCard visual is showing blank but matrix is showing value in power bi
Hi i have a card visual and a matrix visual, along with that i have a date slicer (between). scenario: when the date slicer changes the value in the card and well as matrix gets adjusted to the last date in the date slicer. matrix has categories(category column) as a row. Card visual is showing the over all values without the category. problem: for few dates, there are few category missing. When i slelect those dates , card visual does blank, but matrix visual shows value for which the category is present for that day and blank for the category which is not present for the day, shown below. Card visual should show values of 3 of the above category but it just showing blank. Below is the calculation measure for card visual: please give me a solution666Views0likes3CommentsHow to display zero using Measure or column value (when there is no value)?
I am trying to display two zero (0) value for a line where it has column data and measure values. I have this bottom measure which does not display anything because there is no value for [Ave Census]. I would like to know whether I need to do something on the vw_census_trend_MonthToDate_2[Ave Census] first to force to display zero or whether I could just force to add an zero on the measure: I tried something like this but it did not work: Currently, vw_census_trend_MonthToDate_2[Ave Census] is a column data, and there is no value on this column. I also tried something like this, but no success: Bottom is illustration of the three Values: What is best approach/solution?Solved3.6KViews0likes15CommentsFIFO question
Hi, I am trying to "assign" pending orders to batches based on FIFO. I have 2 tables: tblSKU tblPendingOrders I want to add a column to tblSKU showing pending orders. So, with the current pending orders, tblSKU would look like this: Looking for the best way to accomplish this with DAX. Thx!Solved1.4KViews0likes4CommentsDAX for difference between each date and previous date per occurrence
Hi, Please help with DAX to accomplish the following? For each vehicle many jobs are performed at various date intervals. Each time a job is performed, the date (JOB_OPEN_DATE) is captured. Below in the table you can see the JOB_OPEN_DATEs when different jobs in the JOB column were performed at various dates for one selected vehicle. (There are of course many more vehicles.) Question: I don't want to display the actual date when each job was performed as you can see in the below table, but rather the difference between each date and the previous date for each job - in number of days. This is to see clearly the interval (in days) at which the jobs were performed. This means e.g. for the first Job 06-02-005, 2021 June should display (2021-06-23 minus 2020-06-17) = 371 (days). In the same way, 2022 July should display (2022-07-05 minus 2021-06-23) = 377 (days). The ideal solution should like like the below showing number of days: All the data is captured in the same WO WITH JOB DETAIL table. Here sample data from this table: Sample dataset . The data captured in Power BI is here. Not sure if I should add a Date/Calendar table. This Power Bi file contains a date table. You will note the interval between the various jobs differs. One would typically filter on a specific vehicle to monitor service intervals for its many jobs. With thanks, Water663Views0likes2CommentsRunning total up to certain month
Hi, Currently I have a column labled date that has all the dates from 2010 to 2030. I have another columns with lengths for each of these dates. I would like to get a running count of the length for up to the dates in 2014, and then every year after that up to the current year we are in I want to add 10. This will be a line that gradually goes up in my chart. Right now I have, CALCULATE(SUM(table[goal])/5280, Filter(AllSelected(table),YEAR(table[Date]) <= 2014, table[Date before prev month] <> BLANK() ) + (YEAR(TODAY()) - 2014) * 11 but this does not give me a line that gradually goes up. Can someone point me in the right direction?617Views0likes2CommentsQuerying 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