Forum Discussion
Division between 2 Different source tables
- Anonymous5 years ago
Hi SpiroswayGR ,
You can create a measure as below, please find the details in the attachment.
Measure = VAR _rev = CALCULATE ( SUM ( 'Table1'[Revenue] ), FILTER ( 'Table1', 'Table1'[POS FOODS] = SELECTEDVALUE ( 'Table2'[Code] ) ) ) RETURN DIVIDE ( _rev, CALCULATE ( SUM ( 'Table2'[Days] ) ), 0 )If the above one is not your expected result, please provide some sample data with Text format and your expected result with backend logic and specific examples. Thank you.
Best Regards
Hi SpiroswayGR ,
You can create a measure as below, please find the details in the attachment.
Measure =
VAR _rev =
CALCULATE (
SUM ( 'Table1'[Revenue] ),
FILTER ( 'Table1', 'Table1'[POS FOODS] = SELECTEDVALUE ( 'Table2'[Code] ) )
)
RETURN
DIVIDE ( _rev, CALCULATE ( SUM ( 'Table2'[Days] ) ), 0 )
If the above one is not your expected result, please provide some sample data with Text format and your expected result with backend logic and specific examples. Thank you.
Best Regards
Anonymous Thank you again very much.
It was working perfecty with some minor fixes cause i am using "Measures" to calculate revenue so i had to remove "SUM" in both cases and worked perfectly.
Also i was trying to calculate also for LY on same period , i have the revenue_LY , i have days in LY but somehow divide is not working.