Forum Discussion

Kella's avatar
Kella
Frequent Visitor
3 years ago
Solved

DAX Measure - To get only one value for multiple rows

I am new to Power BI, I am facing issue where I want to create a new column based on the Invoice Date and the Invoice No. In below table, I want to calculate "What I want" column using DAX​ measure ...
  • Ahmedx's avatar
    3 years ago

    pls try this

    sum Invoice = SUM('Table'[Invoice])
    
    
    -----
    35 in Invoice = 
     
    VAR _t1 = SELECTEDVALUE('Table'[Invoice No])
    VAR _t2 = SELECTEDVALUE('Table'[Invoice Date])
    VAR _tbl = FILTER(ALL('Table'),'Table'[Invoice No]=_t1&&'Table'[Invoice Date]=_t2)
    VAR Results= RANKX(_tbl,[sum Invoice],,DESC)
    RETURN
    IF(Results =1,35)