multiplier
2 TopicsAdding Quantity of Late Items for Each Year Using DAX
Hello All, I have been working on this DAX for a few days and am not getting the desired result, so figured I would try posting here for a change. Our IT department owns the data and I am unable to add columns within the tables themselves, and must get to what I need via DAX. Our organization deals with "certifications" which are annual income certifications for housing. Sometimes they are behind on recertifying, but our current data does not multiply the past due certification to tell us the quantity of certifications we are behind. I.e. if the last certification was due in March 2020, and was not completed, we are actually missing certifications for March 2020, March 2021, March 2022, and March 2023 - a quantity of 4. But our current system says we only have 1 late certification, which is what I am trying to adjust with this measure. I am trying to use DAX to add a "multiplier" (i.e. add quantity of late items for each additional year) to the current quantity based on the year of the "Next Certification" and what date I select for the report to be "as of" (Slicer Date). It seems I'm close, but whenever the current quantity is "2" (i.e. if it is registering that we had 2 late certifications due in 2020), my measure seems to be adding 2 for each additional year, and is giving me 8 instead of 5 for the late certs with multiplier. Even if our late quantity starts as 2, I only want the measure to add 1 certification for each additional year. Table Name: Certifications Next Certification Reference Column: NextCertification as Date Filter Reference Date: SlicerDate[SlicerDate] Current (incorrect) column with # of late certifications: LateCertificationsNeverFinished Here's what I have for the DAX currently: Total Late Certs with Multiplier = if(hasonefilter(Certifications[NextCertification]), calculate(if([NextCertification as Date]<SlicerDate[SlicerDate], if(DATEDIFF([NextCertification as Date],SlicerDate[SlicerDate],DAY)>365, value([LateCertificationsNeverFinished])+(ROUNDDOWN((DATEDIFF([NextCertification as Date],SlicerDate[SlicerDate],DAY)/365),0)), value([LateCertificationsNeverFinished])), value([LateCertificationsNeverFinished])), filter(values(Certifications),Certifications[FamilyIsCurrent]<>0)), sumx(filter(certifications,[LateCertificationsNeverFinished]>0 && Certifications[FamilyIsCurrent]<>0), if([NextCertification as Date]<SlicerDate[SlicerDate], if(DATEDIFF([NextCertification as Date],SlicerDate[SlicerDate],DAY)>365, value([LateCertificationsNeverFinished])+(ROUNDDOWN((DATEDIFF([NextCertification as Date],SlicerDate[SlicerDate],DAY)/365),0)), value([LateCertificationsNeverFinished])), value([LateCertificationsNeverFinished])))) Thank you for any help!413Views0likes1Comment[DAX] How to apply a multiplier on a Parameter based on a Date and another parameter
Hello all, First post for me here on a problem I have for a few days. I am working on a dashboard displaying sales data for a bunch of shops. To be properly interpreted, the sales numbers has to be adjusted by a multiplier. This multiplier is different for every shop and is changing through time. The multiplier values are stored in a "Multiplier" table : ShopID Date Multiplier 1 01.01.2018 1 1 01.01.2020 1.2 2 01.01.2018 1.1 3 02.03.2019 1.05 On the other end, the sales values are stored in another "Sales"table : ShopID Date SalesNb 1 01.01.2018 545 2 01.01.2018 362 3 01.01.2018 421 1 02.01.2018 532 2 02.01.2018 350 (...) (...) (...) I also have a "DateTable" where I store all the date input of my data model and a "Shop" Table. Regarding the relationships : "DateTable" 1 ---->-----* "Sales" "Shop" 1 ---->---- * "Sales" "Shop" 1 ---->-----* "Multiplier" "DateTable" 1 ---->---- * "Multiplier" My goal is to have a measure that return for a given asset and for a given date, the multiplier that should be apply to the Sales number. This measure will then be used in a SWITCH measure to allow the user to pick if they want the adjusted number or not. Good luck and tell me if you want more information !Solved1.2KViews0likes2Comments