Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
BhaminiParmar12
Contributor III
Contributor III

Max Month Count of Days

This is my Data and I want 
Max Month Count of Days
my max month is december
I want that when I select OCT and NOV then it should give me both month count together is 61 in KPI 

SampleSuperstore:
LOAD
"Order Date",
Month("Order Date") as Month,
Year("Order Date") as Year,
Day("Order Date") as Day,
MonthName("Order Date") as MonthName
FROM [lib://Data Source/Sample - Superstore Main.xlsx]
(ooxml, embedded labels, table is Orders);




I have used this expression =Max(day([Order Date]))
but not working its giving me Total no of max days 

Please help me to get max month count of Days

5 Replies
simsa
Contributor III
Contributor III

Try this:
COUNT(DISTINCT {<Month={"=$(=MAX({1}Month))"}>} ORDER_DATE) 

BhaminiParmar12
Contributor III
Contributor III
Author

Hi @simsa 
I tried but not working as I said I want that for example in filter pane If i select November which has 30  and Oct which has 31   together then in kpi it will show 61 which means 31 + 30 is 61 Count

poklegoguy
Creator
Creator

Try this:
Sum(Aggr(Count(DISTINCT Day), Year, Month))

Padma123
Creator
Creator

In script mention months days like

floor(MonthEnd(date))-floor(Monthstart(date))+1 as days

in KPI use sum(days).

simsa
Contributor III
Contributor III

I am unsure regarding the requirement, is it- by default you just want the count of days for DEC (31)

And in case you select months say Oct+Nov in your case, you want 61 as output?