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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
NELfr
New Member

Calculate column

Hi,

 

Please share your knowledge with me helping me with this issue

 

I have a file with a column "activación_flag" that contains only two values repeatedly (1 and 0) which mean that the 1 are activate and the 0 inactivate status

 

Well im trying to create a meassure or column that indicate the % of 1 and 0 based on the grand total

 

Any ideas?

 

 

1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi, @NELfr 

According to your description , you want to " trying to create a meassure or column that indicate the % of 1 and 0 based on the grand total".

For your need , i recommend you to use the measure to realize your need.

Here are the steps you can refer to :

(1)This is my test data:

vyueyunzhmsft_0-1669168598349.png

(2) We can create a measure like this:

% = DIVIDE(COUNT('Table'[activación_flag]) , CALCULATE( COUNT('Table'[activación_flag]) , ALL('Table')))

(3)Then we can put the field and the measure on the visual and we will meet your need , the result is as follows:

vyueyunzhmsft_1-1669168656836.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Try these measures

Total = countrows(Data)

Activations = calculate([Total],Data[Activation_flag]=1)

De-activations = calculate([Total],Data[Activation_flag]=0)

Activations % = divide([Activations],[Total])

De-activations % = divide([De-activations],[Total])

Drag the last two measures to a multi card visual.

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-yueyunzh-msft
Community Support
Community Support

Hi, @NELfr 

According to your description , you want to " trying to create a meassure or column that indicate the % of 1 and 0 based on the grand total".

For your need , i recommend you to use the measure to realize your need.

Here are the steps you can refer to :

(1)This is my test data:

vyueyunzhmsft_0-1669168598349.png

(2) We can create a measure like this:

% = DIVIDE(COUNT('Table'[activación_flag]) , CALCULATE( COUNT('Table'[activación_flag]) , ALL('Table')))

(3)Then we can put the field and the measure on the visual and we will meet your need , the result is as follows:

vyueyunzhmsft_1-1669168656836.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Bifinity_75
Solution Sage
Solution Sage

Hi @NELfr , if you have a table (column) something like this:

Bifinity_75_0-1669139301953.png

 

You can create this 2 measures:

Activate = DIVIDE(CALCULATE(sum('Table'[activation_flag]),
'Table'[activation_flag]=1),COUNTROWS('Table'),"-")
Inactive = 1 - [Activate]

Best regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.