Forum Discussion
Creating a Measure
SHAKEDALROY the DAX For this is simple:
Salary Measure = SUM(FactParkingViolation[IssuingAgencyAverageYearlySalary])*0.03
Or if you want it always for the year 2016:
UPDATED SYNTAX:
Salary 2016 = SUMX(FILTER(FactParkingViolation, RELATED(Table[IssueDate]) = 2016), [IssuingAgencyAverageYearlySalary])*0.03)
The trick is creating the relationships. You don't need to do the Merge if you don't want to, but you do need to create relationships on FPV.IssuerKey = DI.IssuerKey and DI.IssuingAgencyCode = DIA.IssuingAgencyCode
https://excelwithallison.blogspot.com/search?q=relationships
Hi AllisonKennedy thank you for your reponse,
i needed to make that merge for different calculations.. i tried to add 'related' to the DAX formula you wrote to me but it still doesn't work, do you know way?
thank you.
- AllisonKennedy5 years agoCommunity Champion
SHAKEDALROY It looks like you have an extra ) before the comma. Sorry, that was my fault as it was in my formula too. That's what I get for writing DAX blindly!
- SHAKEDALROY5 years agoHelper I
i think something is still missing @AllisonKennedy /:
The result in SQL is 18,639,996
and when i tried your formula in Power BI the result is 451,796,281
- AllisonKennedy5 years agoCommunity Champion
How have you done the merge? Did you remove duplicates, your SQL code uses DISTINCT, which we haven't accounted for in the DAX. Also, it's possible to increase rows in merge if you're not careful. https://excelwithallison.blogspot.com/2020/10/merge-ahead-one-for-one.html