Forum Discussion
Calculate the ratio based on two disconnected table
- Anonymous3 years ago
Hi amikm ,
You can try to add Index to both productA and productB tables, so that each row can have [Index] to act as a flag to compare, otherwise the comparison would be the total value of the two tables.
Here are the steps you can follow:
1. In Power Query -- Add Column – Index Column – From 1.
2. Create measure.
Measure_R16= var _AR16= SUMX( FILTER(ALL(ProductA), 'ProductA'[Index]=MAX('ProductA'[Index])),[R16 Sales]) var _BR16= SUMX( FILTER(ALL(ProductB), 'ProductB'[Index]=MAX('ProductA'[Index])),[R16 Sales]) return DIVIDE(_BR16,_AR16)Measure_R6 = var _AR6= SUMX( FILTER(ALL(ProductA), 'ProductA'[Index]=MAX('ProductA'[Index])),[R6 Sales]) var _BR6= SUMX( FILTER(ALL(ProductB), 'ProductB'[Index]=MAX('ProductB'[Index])),[R6 Sales]) return DIVIDE(_BR6,_AR6)3. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523