Hello i am new to Data Visualization and Power Bi and i got into some early problem i have done some measurements for a project but they keep getting saved in my Date table i tried creating a separate Table for measurements but it keeps failing also i have a similar problem with a calculated column, after doing the measurements i did a helper table which went thru but i am not sure it will work correctly because of the problem i already have, in the calculated column i get an error(Token Eof expected.). And so i am not sure if there is a problem with the syntax or what exactly is the problem
1.
Total Sales = SUMX(Sales_Data, Sales_Data[Quantity] * RELATED(Product_Data[Current Price]))
2.
Total Costs = SUMX(Sales_Data, Sales_Data[Quantity] * RELATED(Product_Data[Cost]))
3.
Total Profit = [Total Sales] – [Total Costs]
4.
Total Transactions = COUNTROWS(Sales_Data)
5.
Total Orders = DISTINCTCOUNT(Sales_Data[Order ID])
6.
AVG Quantity Sold = AVERAGE(Sales_Data[Quantity])
7.
Average Quantity Sold Per Month =
AVERAGEX(
SUMMARIZE(
Sales_Data,
Dates[Year],
Dates[MonthInCalendar],
“MonthlyQty”, SUM(Sales_Data[Quantity])
),
[MonthlyQty]
)
8.
Cumulative Profits =
CALCULATE(
[Total Profit],
FILTER(
ALL(Dates),
Dates[Date] <= MAX(Dates[Date])
)
)
9.
Quantity Sold YTD = TOTALYTD(SUM(Sales_Data[Quantity]), Dates[Date])
10.
Quantity Sold LYTD =
CALCULATE(
[Quantity Sold YTD],
SAMEPERIODLASTYEAR(Dates[Date])
)
11.
90Days Running Total =
CALCULATE(
SUM(Sales_Data[Quantity]),
DATESINPERIOD(Dates[Date], LASTDATE(Dates[Date]), -90, DAY)
)
HELPER TABLE CLIENT PROFITABILITY:
Client Profitability =
DATATABLE(
“Profit Group”, STRING,
“Min”, INTEGER,
“Max”, INTEGER,
{
{“Top Clients”, 25000, 1000000},
{“Good Clients”, 20000, 25000},
{“Ok Clients”, 12000, 20000},
{“Poor Clients”, 0, 12000}
}
)
CALCULATED COLUMN:
Profit Group =
VAR TotalProfit = [Total Profit]
RETURN
CALCULATE(
VALUES(‘Client Profitability'[Profit Group]),
FILTER(‘Client Profitability’,
TotalProfit >= ‘Client Profitability'[Min] &&
TotalProfit < ‘Client Profitability'[Max]
)
)
frog1245 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.