Forum Discussion
Measure based on a condition from other table
- 8 years ago
I believe what you want is something along the lines of:
Measure = CALCULATE(SUM(TblForecast[Cost]),FILTER(RELATEDTABLE(Months),[ForecastOrActuals]="F"))
Let me know if that works. If not, I'll try to recreate your data and test.
I believe what you want is something along the lines of:
Measure = CALCULATE(SUM(TblForecast[Cost]),FILTER(RELATEDTABLE(Months),[ForecastOrActuals]="F"))
Let me know if that works. If not, I'll try to recreate your data and test.
- AndresSalomon8 years agoHelper II
Absolutely amazing Greg_Deckler! Worked perfectly. And it will be updated automatically because the column ForecastOrActuals has a DAX formula that put A or F based on other tables conditions. I created a post that is related to this one, maybe you can take a look at it:
https://community.powerbi.com/t5/Desktop/Execute-a-mesure-based-on-a-condition/m-p/345453
I need to start using RELATED and RELATEDTABLE... Still newbie into this world.
Thank you very much! :robothappy:
Regards,- Greg_Deckler8 years agoCommunity Champion
Hah! My DAX must be getting better! Usually when I try to write a formula from memory instead of recreating the scenario I make some stupid syntax error!! :) I'll take a look at the link.