Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
('Fact Table'[CP ID]) - This column contains Chargepoint ID number
('Fact Table'[Start Date]) - Start Date over 2 years data.
I must calculate the Average number of Sessions per Unique CP ID number per day.
How many times the 'Unique' Chargepoint ID was used per day.
CP ID | Start | |
52562 | 29/10/2020 | |
35360 | 03/06/2020 | |
33210 | 24/04/2020 | |
22300 | 29/08/2020 | |
23410 | 17/07/2020 | |
10181 | 23/10/2020 |
I do appreciate assistance on this.
Solved! Go to Solution.
[@val] is the column added by ADDCOLUMNS, which in this case hold the total number of entries for that CP ID for that day. this is what is then averaged by the AVERAGEX function.
When I create columns on temporary tables for use in functions like this I usually prefix the column with an @ to make sure there is no possibility of it clashing with an actual column or measure.
[@val] is the column added by ADDCOLUMNS, which in this case hold the total number of entries for that CP ID for that day. this is what is then averaged by the AVERAGEX function.
When I create columns on temporary tables for use in functions like this I usually prefix the column with an @ to make sure there is no possibility of it clashing with an actual column or measure.
Avg sessions per day =
var summaryTable = ADDCOLUMNS( SUMMARIZE( 'Fact Table', 'Fact Table'[Start date], 'Fact Table'[CP ID]),
"@val", CALCULATE(COUNTROWS('Fact Table'))
)
return AVERAGEX( summaryTable, [@val])
Hi. Thank you, but what is @VAL?
User | Count |
---|---|
87 | |
72 | |
69 | |
64 | |
55 |
User | Count |
---|---|
99 | |
91 | |
80 | |
74 | |
64 |