Forum Discussion
Anonymous
7 years agoNot applicable
Display unique items that appeared each year
I am new to DAX and using Power Query & Powerpivot in Excel 2016 to transform and load data to a pivot. I am simply trying to get a list of Unique Characteristics Values (CHAR VAL) and their counts (...
- 7 years ago
Anonymous
Try this revision
Distinct Count With Totals = IF ( HASONEFILTER ( tblData[Item Appearance Date (Year) 1] ) && HASONEFILTER ( tblData[CHAR DESCRIPTION] ) && HASONEFILTER ( [CHAR VALUE] ), [DistinctCount], SUMX ( SUMMARIZE ( tblData, [Item Appearance Date (Year) 1], [CHAR DESCRIPTION], [CHAR VALUE] ), [DistinctCount] ) )
Zubair_Muhammad
Community Champion
7 years agoAnonymous
To get the Subtotals i.e for each year
use this formula
Distinct Count With Totals =
IF (
HASONEFILTER ( tblData[Item Appearance Date (Year) 1] )
&& HASONEFILTER ( tblData[CHAR DESCRIPTION] ),
[DistinctCount],
SUMX (
SUMMARIZE (
tblData,
[Item Appearance Date (Year) 1],
[CHAR DESCRIPTION],
[CHAR VALUE]
),
[DistinctCount]
)
)
Anonymous
7 years agoNot applicable
Zubair_Muhammad This gives sub-totals now for only the Year column, and not for the Char Desc or Char Value columns. I think if i add more criteria in the Rows or Columns area of Pivot, then Sub-Totals will not appear for those new criteria, isn't it?
Can this Totals measure be made more Generic so that it calculates unique values and their subtotals and totals correctly, when data is sliced/diced?