Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JohnnyK
Advocate II
Advocate II

Column Totals over another, for percentage

Good day!

 

Simple raw data in 2 table as below.

 

NameWhole year target
Elijah54
Liam82
Noah70
Oliver68
William100

 

NameMonthMonth_number
LiamJan0
LiamFeb8
LiamMar0
NoahJan0
NoahFeb9
NoahMar9
OliverJan10
OliverFeb4
OliverMar3
WilliamJan10
WilliamFeb0
WilliamMar1
ElijahJan8
ElijahFeb7
ElijahMar7

 

 

I want to have a visual to show the month values per name, also the total numbers over the Target (in percentage), ideally like:

 

NameJanFebMarSub-TotalWhole year targetSub-Total over Target
Elijah877225441%
Liam08088210%
Noah099187026%
Oliver1043176825%
William10011110011%

 

With the settings, I can only come up with a matrix as below, and don't know what to do next.

 

Can you please help me? Thank you.

 

3355.png

 

1 ACCEPTED SOLUTION
Avantika-Thakur
Solution Supplier
Solution Supplier

Hi @JohnnyK ,

1)You will be required to make the relationship between two tables filtered in both directions

AvantikaThakur_0-1658305232951.png

2) And you would be required to create below measures -

(1) Jan = CALCULATE(sum('MOnthly values'[Month_number]),'MOnthly values'[Month]="Jan")

(2) Feb = CALCULATE(sum('MOnthly values'[Month_number]),'MOnthly values'[Month]="Feb")

(3) Mar = CALCULATE(sum('MOnthly values'[Month_number]),'MOnthly values'[Month]="Mar")

(4) SubTotal = CALCULATE(SUM('MOnthly values'[Month_number]),ALLEXCEPT('MOnthly values','MOnthly values'[Name]))

(5) Total target = CALCULATE(SUM('Target values'[Whole year target]))

(6) % = 'MOnthly values'[SubTotal]/'MOnthly values'[Total target]

 

3) And pull these measures along with Name column in the Table visual, it will give the below result 

AvantikaThakur_1-1658305392995.png

 

Hope this helps.

 

Please accept the solution if this answers your query.

Thanks!

Avantika

 

View solution in original post

2 REPLIES 2
JohnnyK
Advocate II
Advocate II

@Avantika-Thakur, brilliant! Thank you for your help!

Avantika-Thakur
Solution Supplier
Solution Supplier

Hi @JohnnyK ,

1)You will be required to make the relationship between two tables filtered in both directions

AvantikaThakur_0-1658305232951.png

2) And you would be required to create below measures -

(1) Jan = CALCULATE(sum('MOnthly values'[Month_number]),'MOnthly values'[Month]="Jan")

(2) Feb = CALCULATE(sum('MOnthly values'[Month_number]),'MOnthly values'[Month]="Feb")

(3) Mar = CALCULATE(sum('MOnthly values'[Month_number]),'MOnthly values'[Month]="Mar")

(4) SubTotal = CALCULATE(SUM('MOnthly values'[Month_number]),ALLEXCEPT('MOnthly values','MOnthly values'[Name]))

(5) Total target = CALCULATE(SUM('Target values'[Whole year target]))

(6) % = 'MOnthly values'[SubTotal]/'MOnthly values'[Total target]

 

3) And pull these measures along with Name column in the Table visual, it will give the below result 

AvantikaThakur_1-1658305392995.png

 

Hope this helps.

 

Please accept the solution if this answers your query.

Thanks!

Avantika

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.