Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have this formula and for august it says 12089 in reality i only have 2
If i make a measure for each calculation then put the measure inside it works but i dont want to make measures i want to do everything in this table how?
@eliasayyy That's a really bizarre construct. Can't you just unpivot your 4 columns in Power Query? That would make this super simple. If not, you can do this:
New Table 1 =
VAR __Months =
DISTINCT(
SELECTCOLUMNS(
ADDCOLUMNS(
'Table1',
"Month", FORMAT([Date], "MMMM")
),
"Month",[Month]
)
)
VAR __Fields = { "Pageviews", "Entrances", "Exits", "Bounces" }
VAR __Table = GENERATE( __Months, __Fields )
VAR __Result =
SELECTCOLUMNS(
ADDCOLUMNS(
__Table,
"Total",
SWITCH([Value],
"Pageviews", SUMX(FILTER('Table1', FORMAT([Date], "MMMM") = [Month]),[Pageviews]),
"Entrances", SUMX(FILTER('Table1', FORMAT([Date], "MMMM") = [Month]),[Entrances]),
"Exits", SUMX(FILTER('Table1', FORMAT([Date], "MMMM") = [Month]),[Exits]),
"Bounces", SUMX(FILTER('Table1', FORMAT([Date], "MMMM") = [Month]),[Bounces])
)
),
"Fields",[Value],
"Month",[Month],
"Total",[Total]
)
RETURN
__Result
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
12 | |
11 | |
7 | |
6 |