parallelperiod
2 TopicsPrior month DAX using Measure are not displaying any value
Hi everyone, Need your expertise on this issue. What I want to do is to get the variance between current month and last month. But now I am trying to detect the value of last month first before calculate the variance (just minus-ing the value of current month and last month). Unfortunately, the value is not displaying eventhough I have tried all the other methods that are available online. Maybe I missed something? Need your help for this one :') Here is the fact table : Table A We will need to take the last value of EndDateHourDateTime column as it will keep on adding and accumulate throughout the day. For this problem, we are just going to focus on the value of Defect Class = "Produced Glove". There are also ID column which I didnt include in this screenshot. DimDateTime table : Table DimEndDateHourDateTime Just for reference in case you need to refer the data type available inside this table. Measure 1 : To calculate the sum of the Produced Glove Total Produced Glove = Calculate(Sum(A[Value]), Filter(A, A[DefectClass] == "Produced Glove")) Measure 2 : To calculate the previous month of the Produced Glove (below are some of the failed attempts, a bit messy.. sorry)(tried parallelperiod also, but failed.. sobs) Total Produced Glove last Month = var a = VALUES(DimEndDateHourDateTime[FullDateAlternateKey]) var b = DATEADD(a, -1, MONTH) var c = Calculate(Sum(A[Value]), Filter(A, A[DefectClass] == "Produced Glove")) return Calculate(Sum(A[Value]), Filter(ALL(DimEndDateHourDateTime), DimEndDateHourDateTime[FullDateAlternateKey] in b ), Filter(A, A[DefectClass] == "Produced Glove")) @ Variance = //var a = CALCULATE([@ Card_Date], DATEADD(DimEndDateHourDateTime[FullDateAlternateKey], -1, MONTH)) CALCULATE(SUM(A[Value]), PREVIOUSMONTH(DimEndDateHourDateTime[FullDateAlternateKey])) Not sure, where went wrong.. my table become like this.. not displaying the value Need your help for this one :')434Views0likes0CommentsDAX Previous Quarter with date table that can span over years
In my data model I have two tables, one is named "Sales" and the other is my "Dates" table. The Dates table is flagged as a date type table. In my Sales table I have a SoldOn date and the data type is date. I join the SoldOn date to the Date in the date table in my model. Now I want to calculate the previous quarter data and be able to move across years. I already have a measure in the model named GrossSales, this is what I want to see previous quarter totals on. First I try this: PVQTR:=CALCULATE([GrossSales], PARALLELPERIOD('Sales'[SoldOn], -1, quarter)) And this works using the date from the Sales table, but in my report I want to use the Date table to filter this data. So in my date table I have a value for Year Quarter. I want to use that in a slicer so the user can select the starting quarter. Even though those tables have a relationship, the measure above does not display the correct previous quarter when slicing on a value from the Date table. If I change the measure to use the date value from the Date table it doesn't work at all. PVQTR:=CALCULATE([GrossSales], PARALLELPERIOD('Dates'[Date], -1, quarter)) I feel like I am missing something simple here. Any feedback is appreciated.Solved896Views0likes2Comments