Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
rocky_puff
Frequent Visitor

Prior 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.

rocky_puff_0-1674715465402.png

 

DimDateTime table : Table DimEndDateHourDateTime 

Just for reference in case you need to refer the data type available inside this table.

rocky_puff_1-1674715623274.png


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

rocky_puff_2-1674716404938.png

 

 Need your help for this one :')

0 REPLIES 0

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.