Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

% of Total - Help please!

Hi there, 

 

I'm hoping someone can help me with a % of total DAX based on an existing measure. 

 

Basically, I have created a measure that filters for 'matched' emails only: Total Matched emails = 

CALCULATE(DISTINCTCOUNTNOBLANK(greaterdata_tb_fact_population[hashedemail]),greaterdata_tb_fact_population[matched]="true")
 
This gives the total matched against any of the other colums in the table - age, gender, income etc.
 
I'd like a measure to give the % based on this total matched email total (not the total of all emails which I can figure out) 
 
I've tried a few different things but keep getting '100%' across all 
 
Here's an example of the table I'm testing with. As you can see, my formula for '% of total pop' works, but I'm trying to get one that gives % of total matched, across any dimension I need (eg: age, gender etc.) 
 

 

Any ideas?!

 

Thank you so much

Sonia

  • Anonymous Try this:

     

    % Measure = 
    DIVIDE (
       [Total Matched Emails],
       CALCULATE ( [Total Matched Emails], ALLSELECTED ( YourTableName )
    )

     

     

    ‌‌ Follow us on LinkedIn and to our YouTube channel
    I would ❤ Kudos if my solution helped. ‌‌ If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    ‌‌ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.

3 Replies

  • Anonymous Try this:

     

    % Measure = 
    DIVIDE (
       [Total Matched Emails],
       CALCULATE ( [Total Matched Emails], ALLSELECTED ( YourTableName )
    )

     

     

    ‌‌ Follow us on LinkedIn and to our YouTube channel
    I would ❤ Kudos if my solution helped. ‌‌ If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    ‌‌ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you, parry2k - that worked! I'd tried something very similar, but must have had it slightly off... 

     

    Thanks again!

    Sonia

  • Anonymous glad to hear it worked, you need to understand what made it work. Cheers!

     

     

    ‌‌ Follow us on LinkedIn and to our YouTube channel
    I would ❤ Kudos if my solution helped. ‌‌ If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

     

    ‌‌ Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.