Forum Discussion

DJKarma's avatar
DJKarma
Frequent Visitor
3 years ago
Solved

Get Count in Query Editor by 2 Columns

I have to create such a column in PowerBI Query Editor   This is the base table -- Customer ID Unit ID Date  Stamped 1 XX 1st jan 1 1 YY 1st jan 2 1 XX 2nd jan 2 1 YY ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi DJKarma ,

    Please have a try.

    Create a measure.

    Measure = calculate(SUM('Table'[STAMPED]),FILTER(ALL('Table'),'Table'[DATE]=SELECTEDVALUE('Table'[DATE])&&'Table'[customer is]=SELECTEDVALUE('Table'[customer is])))

    Or a column.

    Measure = calculate(SUM('Table'[STAMPED]),FILTER(('Table'),'Table'[DATE]=EARLIER('Table'[DATE])&&'Table'[customer is]=EARLIER('Table'[customer is])))

    Best Regards

    Community Support Team _ Polly

     

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