Forum Discussion

joseclaudio's avatar
joseclaudio
New Member
2 years ago
Solved

Help counting values from one table to another table

Hello, need help with two columns in a table (non unique values) that need to be counted on another table with unique values   Table A: Serial Number EoL Date 2 EoV Date FCH2048FT8P Not P...
  • Moetazzahran's avatar
    2 years ago

    Hello joseclaudio,

    I created two measures Measure_EOL,Measure_EOV

     

    Measure_EOL =
    VAR currentselection=SELECTEDVALUE('Unique'[Unique Date])
    VAR Tablecount=CALCULATE(COUNT('Table'[Serial Number]),'Table'[EoL Date 2]=currentselection,ALLEXCEPT('Table','Table'[EoL Date 2]))
    RETURN
    Tablecount
     
    Measure_EOV =
    VAR currentselection=SELECTEDVALUE('Unique'[Unique Date])
    VAR Tablecount=CALCULATE(COUNT('Table'[Serial Number]),'Table'[EoV Date]=currentselection,ALLEXCEPT('Table','Table'[EoV Date]))
    RETURN
    Tablecount

    To explain:
    SELECTEDVALUE('Unique'[Unique Date]): Captures the currently selected date from the 'Unique' table.
    CALCULATE: Calculates the count of 'Serial Number' based on the conditions provided.
    ALLEXCEPT: Clears all filters on the 'Table' except those on the specified column ('EoL Date 2' or 'EoV Date').

    If this serves the purspose and solves your requirement, please accept it as a solution and your kudo will be much appreciated.