Forum Discussion
Need a DAX measure to replace an Excel function.
- 7 years ago
Hi there,
I wish everyone was as clear in describing their needs! :)I think the below will help you.
I simply created the running total for both columns, devided it and *1000.Calc = DIVIDE( CALCULATE( SUM('Table'[Number of Complaints]); FILTER( ALLSELECTED('Table'[Month]); ISONORAFTER('Table'[Month]; MAX('Table'[Month]); DESC) ) ); CALCULATE( SUM('Table'[Number of Key Transactions]); FILTER( ALLSELECTED('Table'[Month]); ISONORAFTER('Table'[Month]; MAX('Table'[Month]); DESC) ) ) )*1000Hope this helps.
OK I have done something very wrong here. Why is is this so difficult!!
My Measure:
Calc2 =
DIVIDE(
CALCULATE
(SUM('Monthly Complaints Received'[MonthVolume]),
FILTER(
ALLSELECTED('Date_Table'[Month]),
ISONORAFTER(Date_Table[Month],MAX(Date_Table[Month]), DESC)
)
), CALCULATE(
SUM('Total_key_Transactions'[Total Key Transactions]),
FILTER(
ALLSELECTED(Date_Table[Month]),
ISONORAFTER(Date_Table[Month],MAX(Date_Table[Month]),DESC)
)
)
)*1000Your measure:
Calc =
DIVIDE(
CALCULATE(
SUM('Table'[Number of Complaints]);
FILTER(
ALLSELECTED('Table'[Month]);
ISONORAFTER('Table'[Month]; MAX('Table'[Month]); DESC)
)
); CALCULATE(
SUM('Table'[Number of Key Transactions]);
FILTER(
ALLSELECTED('Table'[Month]);
ISONORAFTER('Table'[Month]; MAX('Table'[Month]); DESC)
)
)
)*1000Our measures are basically a mirror of each other. So why am I getting a different outcome to you?
Are you able to share your sample file so I may see how you acheived this in mintues what is currently taking me hours.
:smileysad:
try this:
(relace month by your date value in that table)
Calc2 =
DIVIDE(
CALCULATE
(SUM('Monthly Complaints Received'[MonthVolume]),
FILTER(
ALLSELECTED('Monthly Complaints Received'[Month]),
ISONORAFTER('Monthly Complaints Received'[Month],MAX('Monthly Complaints Received'[Month]), DESC)
)
), CALCULATE(
SUM('Total_key_Transactions'[Total Key Transactions]),
FILTER(
ALLSELECTED('Monthly Complaints Received'[Month]),
ISONORAFTER('Monthly Complaints Received'[Month],MAX('Monthly Complaints Received'[Month]),DESC)
)
)
)*1000 Looks like I already deleted the sample file.
If its doesnt work now, I'll remake it :)
- RobbeVL7 years agoImpactful Individual
Here you go
https://drive.google.com/open?id=1v9ba_6hnUGYNv8P2B61UIcGy3rDYw6_X
Also use the date in your FACT table, NOT from a dimension. That might help the problem.
- RobbeVL7 years agoImpactful Individual
Welcome!
Please mark as resolved! :)