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.
DEFINE
COLUMN DataSource[ym] =
YEAR ( DataSource[date] ) * 100
+ MONTH ( DataSource[date] )
COLUMN DataSource[day] =
DAY ( DataSource[date] )
MEASURE DataSource[Sales] =
SUM ( DataSource[Count_Orders] )
MEASURE DataSource[MonthlySales] =
VAR t0 =
SUMMARIZECOLUMNS (
DataSource[shop_id],
DataSource[shop_name],
DataSource[date],
DataSource[ym],
DataSource[day],
"@Sales", [Sales]
)
VAR dp = [shop_id]
VAR dp_name = [shop_name]
VAR ymm = [ym]
VAR dt = [day]
VAR filter_table =
FILTER (
t0,
dp = [shop_id]
&& dp_name = [shop_name]
&& ymm = [ym]
&& dt = [day]
&& [@Sales] <= [Sales]
)
VAR result =
SUMX ( filter_table, [@Sales] )
RETURN
result
EVALUATE
SUMMARIZECOLUMNS (
DataSource[shop_id],
DataSource[shop_name],
DataSource[date],
DataSource[ym],
DataSource[day],
"SALE", DataSource[Sales],
"M_SALE", DataSource[MonthlySales]
)
The above statement shows an error in DAX-STUDIO, but I don't know how I should build the correct code,
I'm just a beginner, a lot of mistakes, please forgive me, thank you very much!!!
@Tabor
From the initial observation I could see that you used Summarizecolumns in a measure DataSource[MonthlySales], which will fail to execute. Can you share the error message?
This is my error message, please help me check, thanks again!
@Tabor
Error message will be above that line. Please share the pbix if possible
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |