We're giving away 30 tickets for FREE! Share your story, your vision, or your hustle and tell us why YOU deserve a ticket.
Apply nowWin a FREE 3 Day Ticket to FabCon Vienna. Apply now
Hi,
Please share your sample pbix file's link, and then I can see what other columns are also involved. In the picture, I could not see what is under Category column in the visualization.
Thanks.
Hi,
Thank you for your message.
expected result measure: =
VAR _t =
ADDCOLUMNS (
FILTER (
ALL ( Data ),
Data[Category] = MAX ( Category[Category] )
&& Data[StartDate] <= MAX ( 'Calendar'[Date] )
&& Data[EndDate] >= MIN ( 'Calendar'[Date] )
),
"@daycount",
SWITCH (
TRUE (),
Data[EndDate] > MAX ( 'Calendar'[Date] )
&& Data[StartDate] < MIN ( 'Calendar'[Date] ),
MAX ( 'Calendar'[Date] ) - MIN ( 'Calendar'[Date] ) + 1,
Data[EndDate] > MAX ( 'Calendar'[Date] )
&& Data[StartDate] >= MIN ( 'Calendar'[Date] ),
MAX ( 'Calendar'[Date] ) - Data[StartDate] + 1,
Data[EndDate] <= MAX ( 'Calendar'[Date] )
&& Data[StartDate] < MIN ( 'Calendar'[Date] ),
Data[EndDate] - MIN ( 'Calendar'[Date] ) + 1,
Data[EndDate] <= MAX ( 'Calendar'[Date] )
&& Data[StartDate] >= MIN ( 'Calendar'[Date] ),
Data[EndDate] - Data[StartDate] + 1
)
)
RETURN
DIVIDE ( SUMX ( _t, [@daycount] ), COUNTROWS ( _t ) )
Hi,
Please share your sample pbix file's link, and then I can see what other columns are also involved. In the picture, I could not see what is under Category column in the visualization.
Thanks.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
expected result measure: =
VAR _t =
ADDCOLUMNS (
FILTER (
Data,
Data[StartDate] <= MAX ( 'Calendar'[Date] )
&& Data[EndDate] >= MIN ( 'Calendar'[Date] )
),
"@daycount",
SWITCH (
TRUE (),
Data[EndDate] > MAX ( 'Calendar'[Date] )
&& Data[StartDate] < MIN ( 'Calendar'[Date] ),
MAX ( 'Calendar'[Date] ) - MIN ( 'Calendar'[Date] ) + 1,
Data[EndDate] > MAX ( 'Calendar'[Date] )
&& Data[StartDate] >= MIN ( 'Calendar'[Date] ),
MAX ( 'Calendar'[Date] ) - Data[StartDate] + 1,
Data[EndDate] <= MAX ( 'Calendar'[Date] )
&& Data[StartDate] < MIN ( 'Calendar'[Date] ),
Data[EndDate] - MIN ( 'Calendar'[Date] ) + 1,
Data[EndDate] <= MAX ( 'Calendar'[Date] )
&& Data[StartDate] >= MIN ( 'Calendar'[Date] ),
Data[EndDate] - Data[StartDate] + 1
)
)
RETURN
DIVIDE ( SUMX ( _t, [@daycount] ), COUNTROWS ( _t ) )
User | Count |
---|---|
13 | |
12 | |
8 | |
8 | |
6 |
User | Count |
---|---|
28 | |
19 | |
13 | |
11 | |
7 |