Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Based on 2 columns dynamic percentage is not generating accurately using PowerBI DAX

the formula using to calculate percentage is below ErrorPercentage = (ErrorRecors/ScannedRecord) * 100 But when changing the date range using the slicer the error percentage is not changing...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi  Anonymous ,

     

    Here are the steps you can follow:

    1. Create measure.

    Measure =
    var _table=
    SUMMARIZE('Table',[InvNo],[ScannedRecords])
    var _test1=SUMX(FILTER(_table,[InvNo]=MAX('Table'[InvNo])),[ScannedRecords])
    var _test2=COUNTX(FILTER(ALLSELECTED('Table'),'Table'[InvNo]=MAX('Table'[InvNo])),[ErrorRecords])
    return
    DIVIDE(
        _test2,_test1)

    2. Result:

     

    Best Regards,

    Liu Yang

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