Forum Discussion

Anees91's avatar
Anees91
Frequent Visitor
1 year ago
Solved

DAX not working

Hi guys I'm working on a Pbi dashboard, mainly it's working fine, however I have an issue. so i have two columns for example, count of failure code and total delivery volume (including failure) .. i ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Anees91 ,

    I made simple samples and you can check the results below:



    Table 2 = SUMMARIZE('Table',[Category])
    
    Measure = var _s = SELECTEDVALUE('Table 2'[Category])
    var _sum = COUNT('Table'[ID])
    var _total = CALCULATE(COUNT('Table'[ID]),REMOVEFILTERS('Table'[Category]),FILTER('Table',[Fail]="Yes"))
    var _selecet = CALCULATE(COUNT('Table'[ID]),FILTER('Table',[Fail]="Yes"&&[Category]=_s))
    RETURN IF(HASONEFILTER('Table 2'[Category]),1-DIVIDE(_selecet,_sum),1-DIVIDE(_total,_sum))

     

    An attachment for your reference. Hope it helps!

     

    Best regards,
    Community Support Team_ Scott Chang

     

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