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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ajguzman
Regular Visitor

How i can calculate the percent of "type" of each month in power bi?

Hi, how i can calculate the percent of "type" of each month in power bi?¿Quick measure?

NAMETYPEMONTHYEAR
AndyC32019
MichaelA32019
DianaB32019
LuisA32019
YasmeB32019
KatiC32019
RafaA32019
YuliB32019
AngeA32019
AndyA42019
MichaelA42019
DianaA42019
LuisB42019
YasmeB42019
KatiB42019
RafaC42019
YuliC42019
AngeC42019
WeymanA42019

 

Graphic Example:

 month
 34
A44%40%
B33%30%
C22%30%

 

in a power bi stacked column chart

1 ACCEPTED SOLUTION
Anonymous
Not applicable

You can use this measure:

Measure = 
DIVIDE( 
    COUNTROWS(Table2),
    CALCULATE( 
        COUNTROWS( Table2 ), 
        ALLEXCEPT(Table2, Table2[MONTH])
    )
)

which produces this matrix and the associated bar chart:

% of Whole with Stacked Bar Chart.png

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

You can use this measure:

Measure = 
DIVIDE( 
    COUNTROWS(Table2),
    CALCULATE( 
        COUNTROWS( Table2 ), 
        ALLEXCEPT(Table2, Table2[MONTH])
    )
)

which produces this matrix and the associated bar chart:

% of Whole with Stacked Bar Chart.png

Hi

 

Assuming you are just counting the number of items in the table the calculation could look something like this.

 

 

[% of Month Total]=DIVIDE(COUNTROWS('Table1') , CALCULATE(COUNTROWS('Table1'),all(Table1[Type])))

This is the result I got

# I did it in Power Pivot but it is the same for Power BI

 

Capture.JPG

 

 

 

 

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.