Forum Discussion
TREATAS with 2 conditions same table
- 4 years ago
Hi,
The problem is in your time group columns. The values in the two tables don't match.
In Sales you have values:
Whereas in Budget you have:
So when treatas brings the filter over from Sales to budget nothing matches and you get a blank result.
Hi pedroccamaraDBI, At first glance your usage of TREATAS should work from a syntax point of view. I suspect there is some other interaction happening in your model or the [New Budget] measure. Can you ideally share a demo pbix file or the DAX for the [New Budget] measure?
- pedroccamaraDBI4 years ago
Post Partisan
Hi bcdobbs
That one is a simple oneNEW Budget = SUM('Tab Budget'[Budget] )This is my budget tableThank you for steping in- bcdobbs4 years ago
Community Champion
Can you share what the main Tab Sales table looks like and also a picture of the model view?
- littlemojopuppy4 years ago
Community Champion
Curious about your data model because this seems harder than it ought to be. Your description says
- my sales table has Date, Family, TimeGroup and Net sales
- My budget table, which has been done by day has the Date column, Family, Time Group and Budget value
Do you have a date table and it marked appropriately? And then relationships from the date table to date in the Budget table and MM-YYYY as a field in the date table and related to the sales table? Because if you have those things (along with a proper dimension table for Family) this should be easy peasy. Your measures for this should be simple.
Sales = SUM(SalesTable[Sales]) Budget = SUM(BudgetTable[Budget])Filter context should do everything else for you. I think your data model is off, which is creating a bunch of unnecessary complexity for you.
Would it be possible to provide a pbix with your data model?
- bcdobbs4 years ago
Community Champion
Just seen this. Fully agree with littlemojopuppy