Forum Discussion
Most Frequent value working with slicer
I need help with the displaying the most frequent value in Card visualisation while the selected filters in slicers.
I have tried to create new measure with the most frequest month:
- Anonymous2 years ago
Hi Key123 ,
Based on your description, I created simple samples and you can check the results below:
Most Frequent = var _table=ADDCOLUMNS(ALLSELECTED('Table'),"year",YEAR('Table'[Data]),"month",MONTH('Table'[Data])) var _b= SUMMARIZE(_table,[month],"count of id",COUNT('Table'[ID])) return CALCULATE(MAXX(FILTER(_b,[count of id]=MAXX(_b,[count of id])),[month]))An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott ChangIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.
5 Replies
- vicky_
Super User
Here's something using some of my own sample data:
Most common month = var months = VALUES('Table'[Month]) return TOPN(1, months, 'Table'[Month], ASC, COUNT('Table'[Month]))Hope this helps.
- Ashish_Mathur
Super User
Hi,
Your requirement is not clear. Clearly show the result you are expecting.
- Key123Regular Visitor
Hello,
I have the column with dates:
Trying to make card type visualisation with the most frequent Month based on the filters in slicers.
How the result should be shown:
The example of slicer:
While selecting specific year in slicer, the value in the card visualisation (TopMonth) is not changing.
- Ashish_Mathur
Super User
Hi,
Create a Calendar Table with calculated column formulas for Year, Month name and Month number. Sort the Month name column by the Month number. Create the year slicer from the Calendar Table. Create a relationship (Many to One and Single) from the Date column of your Data Table to the Date column of the Calendar Table. Write these measures
Measure = countrows(Data)
Meausre 1 = MAXX(VALUES(Calendar[Month name]),[Measure])
Hope this helps.
- AnonymousNot applicable
Hi Key123 ,
Based on your description, I created simple samples and you can check the results below:
Most Frequent = var _table=ADDCOLUMNS(ALLSELECTED('Table'),"year",YEAR('Table'[Data]),"month",MONTH('Table'[Data])) var _b= SUMMARIZE(_table,[month],"count of id",COUNT('Table'[ID])) return CALCULATE(MAXX(FILTER(_b,[count of id]=MAXX(_b,[count of id])),[month]))An attachment for your reference. Hope it helps!
Best regards,
Community Support Team_ Scott ChangIf this post helps then please consider Accept it as the solution to help the other members find it more quickly.