Forum Discussion
All() dax not working
- 8 years ago
Hi Johan,
Create a table with status:
Status
Open Planned Production
Then make an inactive relationship between Status table and Products Table:
Change your two measure to the following code:
Ordered last year = CALCULATE ( SUM ( Orders[Ordered qty.] ); 'Calendar'[YearsAgo] = 1 ) Ordered this year = CALCULATE ( SUM ( Orders[Ordered qty.] ); 'Calendar'[YearsAgo] = 0; USERELATIONSHIP ( 'Status'[Status]; Products[Status] ) )Now use the Status table on your slicer and everything should work as you want:
Regards,
MFelix
Hi Johan,
Believe that your problem is not DAX related, but visual related, you need to select the Ediut interactions and remove the slicer interaction from the table with order from last year.
Regards
MFelix
- Johan8 years ago
Advocate II
Thanks for taking the time to help.
Edit interactions can help is some situations, but not all.
What if I want to display them in 1 table?
Slicer filter = Planned (should only apply to this year)
This year Last Year Mercedes Planned 20 Ford Planned 25 Audi Closed 30 Toyota Closed 35 Ferrari Closed 40 Lada Closed 45 Kind regards,
Johan
- MFelix8 years ago
Super User
Hi Johan,
Create a table with status:
Status
Open Planned Production
Then make an inactive relationship between Status table and Products Table:
Change your two measure to the following code:
Ordered last year = CALCULATE ( SUM ( Orders[Ordered qty.] ); 'Calendar'[YearsAgo] = 1 ) Ordered this year = CALCULATE ( SUM ( Orders[Ordered qty.] ); 'Calendar'[YearsAgo] = 0; USERELATIONSHIP ( 'Status'[Status]; Products[Status] ) )Now use the Status table on your slicer and everything should work as you want:
Regards,
MFelix
- Johan8 years ago
Advocate II
Thanks a lot MFelix, this really helped.
I don't understand quite yet why the relation must be inactive in order to have the all() condition working. But it's working, thanks again!
Johan.