Forum Discussion
Percentage Calculation between two tables
- 5 years ago
Hi YavuzDuran ,
Be sure that in both 2 tables have the column of MonthNo;
In your calendar table,also create a MonthNo column;
Then create a measure as below:
Measure = var _closedaccounts=CALCULATE(SUM('Table (2)'[Value]),FILTER(ALL('Table (2)'),'Table (2)'[Column]=MAX('Calendar'[MonthNo])&&'Table (2)'[Row]=MAX('Table (2)'[Row]))) var _totalsales=CALCULATE(SUM('Table'[# of Acts]),FILTER(ALL('Table'),'Table'[MonthNo]=MAX('Calendar'[MonthNo]))) Return DIVIDE(_closedaccounts,_totalsales)And you will see:(here I only take part of your sample data)
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
In other words,
I am trying to find the percentage of total row (total row of the second table (sales))
Hi YavuzDuran ,
Be sure that in both 2 tables have the column of MonthNo;
In your calendar table,also create a MonthNo column;
Then create a measure as below:
Measure =
var _closedaccounts=CALCULATE(SUM('Table (2)'[Value]),FILTER(ALL('Table (2)'),'Table (2)'[Column]=MAX('Calendar'[MonthNo])&&'Table (2)'[Row]=MAX('Table (2)'[Row])))
var _totalsales=CALCULATE(SUM('Table'[# of Acts]),FILTER(ALL('Table'),'Table'[MonthNo]=MAX('Calendar'[MonthNo])))
Return
DIVIDE(_closedaccounts,_totalsales)
And you will see:(here I only take part of your sample data)
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!