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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
adamsli
Helper I
Helper I

Divide columns to calculate share

Hi,

I'm a rookie in Power BI so currently I don't know how to divide ""TAK" answers with Total("Suma").

I created a matrix like that:

adamsli_1-1595924707458.png

 

How to divide "TAK" with Total in Power BI for every month?

Something similar like in Excel:

adamsli_2-1595924895711.png

No/Yes answers and Total are from two seperates columns. I want to show share of "TAK" answers for each month compared to total.

 

Regards,

Adam

4 REPLIES 4
Anonymous
Not applicable

// To do that you have to remove the filter from
// the attribute that stores your Tak/Nie. This
// depends on the structure of the model a bit,
// though...

// Say that the measure that calculates the number
// of answers (Tak, Nie, Blank) is:

[Answer Count] = COUNTROWS( T[Answer] )

// Then...

[% of Answers (abs)] =
var __currentCount = [Answer Count]
var __totalCount = 
	CALCULATE(
		[Answer Count],
		ALL( T[Answer] )
	)
return
	DIVIDE( __currentCount, __totalCount )
	
// If you want to have relative percentages,
// so-called "visual totals", then...

[% of Answers (rel)] =
var __currentCount = [Answer Count]
var __totalCount = 
	CALCULATE(
		[Answer Count],
		ALLSELECTED( T[Answer] )
	)
return
	DIVIDE( __currentCount, __totalCount )
harshnathani
Community Champion
Community Champion

Hi @adamsli ,

 

 

Try this.

 

Total SUM = SUM('Table'[Values])

Total SumALL = CALCULATE ([Total SUM] , ALL('Table'])

 

Measure = DIVIDE ([Total SUM], [Total SumALL])

 

Regards,

Harsh Nathani

The problem is that column with answers are text type not value and I can't convert it to the value for example decimal number in power query cause I'm receiving error in rows.

@adamsli , correct the error, use replace before data type conversion if needed.

You need to have numbers

 

refer, how to handle error in power query
https://www.youtube.com/watch?v=OE6DPmKqN7s
https://www.youtube.com/watch?v=9-Lag0VOiTs

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.