Forum Discussion
Most repeated text value for time range
Hi Zain26,
You can create a calculated table below:
Table = SUMMARIZE('Table2','Table2'[Names],'Table2'[Time Range],"count",COUNT(Table2[Time Range]))
Then create a measure:
Most Ocurring time range = LOOKUPVALUE('Table'[Time Range],'Table'[Names],MAX('Table'[Names]),'Table'[count],CALCULATE(MAX('Table'[count]),ALLEXCEPT('Table','Table'[Names])))
Best Regards,
Qiuyun Yu
I receive an error using your solution. Here is what I actually want to acquire from the data.
These are my columns, where CountofTimeRange is a calculated column which shows me the count of each time range occuring for a user in the specified dates.
USER | TimeRange | CountofTimeRange|
BANK 9pm-12am 54
BANK 6pm-9pm 24
BANK 6pm-9pm 24
BANK 3pm-6pm 54
STORE 9pm-12am 96
STORE 12pm-3pm 34
STORE 6pm-9pm 78
STORE 3pm-6pm 10
SCHOOL 9am-12pm 5
SCHOOL 12pm-3pm 120
SCHOOL 6pm-9pm 1
SCHOOL 3pm-6pm 2
==================================
I want to get the value 9pm-12am against th BANK column, in a row using matrix visualization. and ignore the lesser time range. However when I attempt to do this in a measure using
VAR peaktime= Calculate(LookupValue([Timerange],[CountofTimeRange],MAX([CountofTimeRange])),[Date].[month]>= DATE(maxyear,maxmonth,1))
receive an error which says
A table of multiple values was supplied where a single value was expected.
Using the Matrix visual the result should be something like this,
BANK STORE SCHOOL
PeakTime 9pm-12am 9pm-12am 12pm-3pm