Forum Discussion
DAX - Help
- 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.
I'd need sample data to replicate.
Adnumber Title Name Date
001 Bob 01/05/2017
001 Fred 01/06/2017
002 Bob 01/02/2016
So it would return where year is 2017
Number of Ads Number of Titles
1 2
Thanks
- Ashish_Mathur8 years agoSuper User
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.
- Anonymous8 years agoNot applicable
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