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
Anonymous
Not applicable

How to convert general number into percentage for males and females using the Tornado 2.1.0 app.

Hi

I need help to convert the general number displayed in the funnel graph into percentage. When I tried to click on the measure values (Female - green colour) and convert it into percentage, the displayed value is not correct. For example, the actual number of female as shown in the order: 

Female participants: 11, 9, 3, 1, 0, 1

 

When I tried to convert them into percentage, for the top row, green bar (female) shld show  11/ (20+11) = 35% and the purple bar (male) shld be 20/(20+11) = 65%

 

Likewise for the second row, the green bar (female) shld be 9/(12+9) = 43% and the 2nd purple row (male) shld be 57%. It goes on for the rest.

 

zxavierdeloitte_0-1611891901941.png

zxavierdeloitte_1-1611892380490.png

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

Just add [year] column into the filter formula:

Male = 
DIVIDE (
    CALCULATE (
        COUNT ( 'Table'[Gender] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Business]
                IN DISTINCT ( 'Table'[Business] )
                    && 'Table'[Gender] = "Male"
                    && 'Table'[FY Year] IN DISTINCT ( 'Table'[FY Year] )
        )
    ),
    CALCULATE (
        COUNT ( 'Table'[Gender] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Business]
                IN DISTINCT ( 'Table'[Business] )
                    && 'Table'[FY Year] IN DISTINCT ( 'Table'[FY Year] )
        )
    )
)
Female = 
DIVIDE (
    CALCULATE (
        COUNT ( 'Table'[Gender] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Business]
                IN DISTINCT ( 'Table'[Business] )
                    && 'Table'[Gender] = "Female"
                    && 'Table'[FY Year] IN DISTINCT ( 'Table'[FY Year] )
        )
    ),
    CALCULATE (
        COUNT ( 'Table'[Gender] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Business]
                IN DISTINCT ( 'Table'[Business] )
                    && 'Table'[FY Year] IN DISTINCT ( 'Table'[FY Year] )
        )
    )
)

year.png

Please check the sample file in the below.

 

Best Regards,
Community Support Team _ Yingjie Li
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

11 REPLIES 11
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

You can create measure like this:

Male = 
DIVIDE (
    CALCULATE (
        COUNT ( 'Table'[Gender] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Business]
                IN DISTINCT ( 'Table'[Business] )
                    && 'Table'[Gender] = "Male"
        )
    ),
    CALCULATE (
        COUNT ( 'Table'[Gender] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Business] IN DISTINCT ( 'Table'[Business] ) )
    )
)
Female = 
DIVIDE (
    CALCULATE (
        COUNT ( 'Table'[Gender] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Business]
                IN DISTINCT ( 'Table'[Business] )
                    && 'Table'[Gender] = "Female"
        )
    ),
    CALCULATE (
        COUNT ( 'Table'[Gender] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Business] IN DISTINCT ( 'Table'[Business] ) )
    )
)

percen.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @v-yingjl

THanks. It works. 

 

I got it right but when I tried to use FY slicer to filter by years, the funnel graph did not update accordingly. Previously, the funnel graph that only highlights the absolute number could be updated accordingly whenever I select different years. 

 

Is there any way for me to do something to the DAX formula so that whenever I select different year, the funnel graph should be updated accordingly.

 

Hi @Anonymous ,

Just add [year] column into the filter formula:

Male = 
DIVIDE (
    CALCULATE (
        COUNT ( 'Table'[Gender] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Business]
                IN DISTINCT ( 'Table'[Business] )
                    && 'Table'[Gender] = "Male"
                    && 'Table'[FY Year] IN DISTINCT ( 'Table'[FY Year] )
        )
    ),
    CALCULATE (
        COUNT ( 'Table'[Gender] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Business]
                IN DISTINCT ( 'Table'[Business] )
                    && 'Table'[FY Year] IN DISTINCT ( 'Table'[FY Year] )
        )
    )
)
Female = 
DIVIDE (
    CALCULATE (
        COUNT ( 'Table'[Gender] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Business]
                IN DISTINCT ( 'Table'[Business] )
                    && 'Table'[Gender] = "Female"
                    && 'Table'[FY Year] IN DISTINCT ( 'Table'[FY Year] )
        )
    ),
    CALCULATE (
        COUNT ( 'Table'[Gender] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Business]
                IN DISTINCT ( 'Table'[Business] )
                    && 'Table'[FY Year] IN DISTINCT ( 'Table'[FY Year] )
        )
    )
)

year.png

Please check the sample file in the below.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

VijayP
Super User
Super User

@Anonymous 

Just follow these steps and let me know if this is good!




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Anonymous
Not applicable

Hi @VijayP 

I cannot see your animate gif as the size is so small and I could not see the word or data in the gif. May I request for larger size, pls? 

 

zxavierdeloitte_0-1612136316741.png

 

PhilipTreacy
Super User
Super User

Hi @Anonymous 

Please download this PBIX file with a solution

 

Create these 2 measures

 

 

% Female = DIVIDE( SELECTEDVALUE('Table'[Female]) , SELECTEDVALUE('Table'[Male]) + SELECTEDVALUE('Table'[Female]))
% Male = DIVIDE( SELECTEDVALUE('Table'[Male]) , SELECTEDVALUE('Table'[Male]) + SELECTEDVALUE('Table'[Female]))

 

 

torn-perc.png

 

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

@PhilipTreacy 

Thank you very much. But the thing about your raw data is not the same as mine. I understand where you ar coming from. In your raw data, you have already aggregated the total number of male and female participants for each particular business. In my case, I have individual business that will indicate that the participant is either male or female

 

I agree with your approach but before I obtain your suggested table, how do I need to sum up all male and female participants from particular business into total male and female for that particular business? I am open to your suggestion.

 

My mock table with selected columns

zxavierdeloitte_1-1612136527645.png

 

 

 

VijayP
Super User
Super User

@Anonymous 

I hvcreted additional columns in Power Query, you can usee the Female 1 and Male 1 columsn in that chart

if you can share the pbix wihtout sensitive data i can help you!

VijayP_0-1611896999218.png

 




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


amitchandak
Super User
Super User

@Anonymous , I think in this case you have to create a % column and use that

 

Male % , divide([male], [male]+[female])

female % , divide([male], [male]+[female])

Anonymous
Not applicable

Hi thanks @VijayP @amitchandak 

But the problem is that how do I need to create % column

 

Here is the mock data here:

zxavierdeloitte_2-1611901790539.png

 

 

 

How do I need to create? Do I need to unpivot the gender into Male and Female columns?

Hi,

Create these 2 measures

Male = calculate(distinctcount(data[email]),data[gender] = "male")

Female = calculate(distinctcount(data[email]),data[gender] = "female")

Now use the measures shared by Amit.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.