Forum Discussion
Anonymous
8 years agoNot applicable
DAX - Help
Hi, Have a table with the following format Adnumber Title Name 001 Bob 001 Fred 002 Bob I want to be able to have a measure which counts t...
- Anonymous8 years ago
Hi Anonymous,
You can try to use below formula to get the different count of year group.
Summary table = SUMMARIZE ( ADDCOLUMNS ( Table, "Year", YEAR ( table[Date] ) ), [Year], "Count Titile", DISTINCTCOUNT ( Adnumber[Title] ), "Count AD", DISTINCTCOUNT ( Adnumber[Adnumber] ) )Regards,
Xiaoxin Sheng
- 8 years ago
Hi Anonymous,
Create a calendar table and extract year from the data column of the calendar table using the YEAR() function. Create a relationship from the Date column of your data table to the date column of your calendar table. Drag year from the calendar table to the visual or as a silcer or to the filter section. Select a particular year. Now use the IDSTINCTCOUNT() function.
Anonymous
8 years agoNot applicable
Thanks Greg_Deckler,
I got it to work ok
Table 4 = SUMMARIZE(Query1,Query1[adnumbr],"Number",CALCULATE(DISTINCTCOUNT(Query1[ttlcode]),Query1[ttlcode]="ENS" || Query1[ttlcode]="CN" || Query1[ttlcode]="WN" || Query1[ttlcode]="TS" || Query1[ttlcode]="HC" || Query1[ttlcode]="NWEM", YEAR(Query1[dateins] = 2017)))
but the year part doesnt seem to do anything?
Greg_Deckler
8 years agoCommunity Champion
I'd need sample data to replicate.