Forum Discussion

dofrancis3's avatar
dofrancis3
Icon for Resolver I rankResolver I
2 years ago
Solved

DAX Pourcentage Calculation for text format

Dear Colleagues, Please i need your help ! According to the table below, at "% Status" column i would like to calculate percentage of status  (Fail and Pass) The formula is: Fail or Pass divise by...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, dofrancis3 

    Thank you very much for your reply. First, you need to change the expression of the calculated column to:

    Percentage = 
    VAR _status_fail = CALCULATE(COUNTROWS('repository'),FILTER('repository','repository'[Country]=EARLIER(repository[Country])&&'repository'[Staus]="Fail"||'repository'[Staus]="Pass"))
    VAR _total_status = CALCULATE(COUNTROWS('repository'),FILTER(ALL(repository),'repository'[Staus]="Fail"||'repository'[Staus]="Pass")) 
    RETURN IF(NOT ISBLANK('repository'[Staus]),DIVIDE(_status_fail,_total_status))

    In the top navigation bar, format this column without percentages:

     

     

    How to Get Your Question Answered Quickly

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

    Best Regards

    Jianpeng Li

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