Forum Discussion
joseclaudio
2 years agoNew Member
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...
- 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]))RETURNTablecountMeasure_EOV =VAR currentselection=SELECTEDVALUE('Unique'[Unique Date])VAR Tablecount=CALCULATE(COUNT('Table'[Serial Number]),'Table'[EoV Date]=currentselection,ALLEXCEPT('Table','Table'[EoV Date]))RETURNTablecount
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.
Moetazzahran
Resolver II
2 years agoHello 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.
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.
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.
- joseclaudio2 years agoNew Member
It worked like a charm!!! thanks I've been struggling with these a couple of weeks and now you saved me.