
ในหลักสูตร ท่านจะได้เรียนรู้วิธีการ ดูดข้อมูลจาก Excel มาทำความสะอาดปรับแต่งใน Power Query ลักษณะเดียวกับการเขียน Macro แต่ง่ายกว่ามาก แลัวปรับขนาดไฟล์ให้เล็กลงเพื่อไปออกรายงานต่างๆ ตามต้องการด้วย Power BI
Power BI คือ
•โปรแกรมทำรายงาน แยกอิสระจาก Excel ไม่ปรับเปลี่ยนต้นฉบับ
•มี Power Query เป็นเครื่องมือทำความสะอาด Excel
•มี Power BI ไว้ออกรายงาน
•ออกรายงานเร็วกว่า หลากหลายกว่า
•เอาข้อมูลหลาย Sheets หลาย File มาต่อกันได้
•บันทึกทุกขั้นตอนตัดต่อ ไม่ต้องเขียน Macro
•Update อัตโนมัติ ตามต้นฉบับ
•ลดอ้วนได้ด้วย Data Model
ตัวอย่างแต่ละบทถูกจัดสรรไว้ใน Folder ของแต่ละบท เพื่อการเข้าถึงได้ง่ายหลังบันทึก VDO ไปแล้ว ดังนั้นหากพบการเรียกไฟล์ต่างๆใน VDO ใน path อื่นๆ ให้ข้ามไปใช้ในแต่ละ Folder ที่ถูกจัดสรรใหม่เลย
ถ้าเป็นไปได้ให้เอา Resource ไฟล์ที่ downloaded มา ไปไว้บน Desktop นะครับ จะได้หาง่าย แล้วที่ต้องทำตอนเรียกเปิดตัวอย่างก่อนอื่นเลย คือเลือกที่ตารางด้านซ้าย แล้วไปที่ Source ในบรรทักแรกของ step ด้านขวาของ Power Query Editor กดที่เฟืองด้านหลัง ทำการ Browse หา path ใหม่ที่เอา Resource ไปวางไว้ก่อน ทำอย่างนี้ไปจนหมดตารางที่มันเชื่อมโยงอยู่
ลักษณะของข้อมูลกระจาย vs ฐานข้อมูล
เรียนรู้การเก็บข้อมูลที่ถูกต้อง
การเชื่อมต่อข้อมูลจาก Excel มาทำงานใน Power BI
Duplicate & Reference
Disable Load
Change Type
Fix decimal - got 2 decimal. If want more Transform > Number Column > Rounding
Count Rows - Transform > Count Rows
Home > Remove Rows > Remove Blank Rows (remove only rows that really emply, no any data on every column of that row)
Filter > Remove Emply (remove all rows no matter other columns have data or not)
Filter > Uncheck null (remove all rows no matter other columns have data or not)
เจอ columns ล่องหน Replace Value ให้เป็น null ก่อน
เจอ Error ให้ Replace Errors เป็น null ก่อน
Copy Query to Excel > Left Click at far left corner > Copy Entire Table
Home > Refresh Preview
Right Click on data > Replace Value
Add Column 'Age'
Right Click
Equal
Not Equal
Sort
Filter greater than
Trim
Text Filter-Contain
Number Filter-Greater than
Date Filter-Between
Move Column
Sequence Sort
English (US) MDY
English (UK) DMY
ถ้าต้องการฝืน จาก dd/mm/yy เป็น mm/dd/yy โดยไม่เปลี่ยน Region
Add Custom Column
ใส่สูตร อย่าลืมเปลี่ยนชื่อ Field ให้ตรงกับงาน
= #date(
2000 + Number.FromText(Text.End([PostDate]2))
Number.FromText(Text.Middle([PostDate]32))
Number.FromText(Text.Start([PostDate]2))
)
Must save in Power BI
Home > Close & Apply > to Power BI > Save/Save as
Go to Power Query Editor from Power BI Desktop
Right click on required Table > Edit Query
Split ใช้ได้กับ Text เท่านั้น ตัวเลขใช้ไม่ได้
DMY to MDY
Merge Column
Connect New Excel from inside Power Query Editor > Home > New Source
Find Error from Big Data
Replace Error
Extract
In Filter - 'Load more' for Big Data
Custom from Examples
Day
Month
Year
Year/Month > Text.PadStart([Month],2,"0")
Weekday Name
Month End
Add Column
Standard Calculation
Date
คำนวนวางบิลทุกวันที่ 15 ของเดือนหน้า
Choose Date Data > Add Column > Date > End of Month
Change type to Whole Number > Add Column > Standard Calculation > Add > Value - 15 > Change type back to Date
Add Column > Conditional Column
ถ้ามีผิดอยากเอาออก ให้ Click ที่ สามจุดหลังบรรทัดนั้นๆ จะมี Delete ให้เลือก
Sum
Avg
Min
Max
Change from Horizon to Vertical เปลี่ยนแนวนอนเป็นแนวตั้ง
Change from Vertical to Horizon
Right Click on column head > Fill > down (ถ้า Fill down ไม่ได้ แสดงว่ามีตัวล่องหนอยู่ อย่าง "" หรือ " " ให้เปลี่ยนเป็น null ก่อนด้วยการ Click ที่ตัวล่องหนแล้ว Replace Value จากนั้นก็ Fill > Down ได้เลย
Filter > Remove Empty
Split > Left most paramiter
Select 2 columns both Header and Data
Transform > Pivot Column > Advance > Don't Aggregate
UnPivot
Add Column for Text Input
Disable Load
Add New Group Folder
Add Year
Add Month
Add Custom Column for 01 fomular = Text.PadStart([Month],2,"0")
Merge Column
Power BI Chart
Left Join
Right Join
Full Join
Replace Error
Append
Data Model
Remove Other Columns
Remove Duplicate
สร้างตารางใหม่
Home > Enter Data
Add Column > Index Column > From 1
Left Click on far left corner > Merge Queries
On Power BI
Right Click directly on Query > Edit Query
Replace Value
Put own Index to sort at will
Add Group Column to new Table
ซ้ำเยอะลดได้น้อย
ซ้ำเยอะลดได้น้อย
ซ้ำน้อยลดได้เยอะ
แทบไม่ซ้ำให้ไปลด Data Type แทน
ตรวจสอบด้วย DAX Studio
Report - Visualization
To call out Filter Pane > View > Filter
Check Relation
We can Add Table Visual to show details of other Chart
Filter Interact once we click some values on Report/Visual
More than one column relations need to do in Merge of Power Query
2 Columns lookup cannot be done on Power BI. Must Merge in Power Query first
Choose first lookup column > Ctrl + choose second column
File > Options and settings > Options > Preview features > On-object interaction
For values on each Category
For values on Period of Time
For values on Period of Time 100 %
Compare for each category
Sales vs Cost
Sales vs Profit
Sales vs Transport cost
Waterfall to show which one Push and which one Pull
Funnel for channeling or process/production e.g.
Facebook Ads > Awareness > Basket > Check in > Payment
Production Plan > Cut > Sew > Pack > QC > Shipped
Scatter need 2 values e.g. Sales and Profit on Product
Pie Donut and Tree Map for 100% proportion
File > Options and settings > Options > Security > Map and Filled Map visuals > Use Map and Filled Map Visuals > OK
เหมือนกับ Excel Pivot Table
พยายามอ้างชื่อ Field ให้ตรงกับ Field จริง e.g. sales, Product, COGS, Country will ease QA evaluation
Right Click on Visual > Summarize to call Narrative
View > Pane Manager > Show only one active pane
Right Click on Canvas outside Visual and choose 'Format canvas'
Canvas settings > Type 16:9
Set page background color on 'Wallpaper'
VISUAL FORMAT for Tooltips
Double Click on Chart > On Format Pane choose Properties > Data format > Apply Setting to 'Sum of Sales' > Format Options 'Whole Number' and 'Thousand separator' ON
Remark : Tooltips not shown on 'Format Mode'
Right Click on Label to change Color of each label, change thousand / decimal
Double Click enter Format Mode with Blue Line Border > Right Click on each part (Header, Data, Bottom) > add Grid and Border / Bold / Font / Align
ขยาย Column ต้องออกจาก Format Mode ก่อน
Only on Numeric Data on Table can right click for 'Add cell elements' for Background / Font Color / Data Bar and Icon
Click ที่หัวลูกศรมุมซ้ายบนของแต่ละ column เพื่อ Sort
No Right Click avail for Data Value
Format by Format Pane step by step
Data Label - can separate Data Label Background by
Data Labels > Apply setting to > Series > choose to format for each value > change both value and
background colors
Only Line Chart with Date (not Date Hierarchy) has 'Forecast'
SLICER
Only Text can has 'Search' on. Numeric and Date cannot
Only Date (Just date not Date Hierarchy) can has 'Between' with Slider
Use Ctrl Click instead of Ctrl A for select all
For Shape Background go to 'Shape style' not 'Size and style'
Also giving report Name go to 'Shape style' > Text
Top N stay with Product not Values
Before remove 'Sync Slicer' need to check all Sync effect on other pages first
Right Click on any field of Dataset
New column - Add new column to Dataset - increase file size - calculate row by row as Excel formula
New measure - summarize e.g. sum, average, min, max, just calculate once, not increase file size
Assign new category or new group to our Dataset
Filter - only selected remain
Highlight - Highlight the selected and other transparent
None - No interact with others
3 and 4 Will active only after we back to top with 1 first
Right Click on Visual > Show as a table > for all chart
Right click on individual Column Chart > Show data point as a table > for specific data of each column chart
Sort by other columns instead
In Table View > Column tools > Sort by column
Weekday-Nr = WEEKDAY([Date],2)
Weekday-Name = FORMAT([Date],"ddd")
Sort by Other Columns
Demo by Logistic.xlxs
Export Data from Visual - Left Click on "..." on top right of visual > Export Data
Power BI > Table View > Right Click on individual table > Copy table (Go All)
Power Query > Left Click on Top Left Corner of Table > Copy Entire Table (Copy only Max 1000)
PowerPoint > Insert > Screenshort
Go to Query Editor In Excel > Data > From Table or Range
No BLANK rows allowed
Add Column > Date > Month > End of Month
Add 15 days to End of Month > Change Date Type to Whole Number > Add Column > Standard > Add > 15 days > Change back to Date >
Find Age > Add Column > Date > Age > Change Type to Whoe Number
Home > Close and Load to Excel
Query Menu will appeared only once we choose Query Sheet
To Edit Query > Choose Query Sheet > Query > Edit
Header and Details Problem
Check Header =IF(ISBLANK(C7),B7,"")
Ctrl Select Header Cell > Insert Row > Shift cell down
Right Click on column head > Fill > down
ถ้า Fill down ไม่ได้ แสดงว่ามีตัวล่องหนอยู่ อย่าง "" หรือ " "
ให้ Filter > Blank ก่อน แล้วเปลี่ยนเป็น null ด้วยการ Click ที่ตัว Blank หรือ ตัวล่องหนแล้ว Replace Value
เป็น null จากนั้นก็ Fill > Down ได้เลย
(ถ้าไม่ Filter > Blank ก่อน จะไม่มี Replace Value ให้เลือกตอน click ขวา
For Max and Count
Use Group by > Advanced > Add Aggregation
Change Age from 'null' to 0 for using in Conditional Column
Use ELSE for non movement stock which is 0 on MaxDate
Just right click and delete unconcerned worksheet e.g. Header and Details
Multiple Merge has only in Power Query Editor
Lookup first column then Ctrl + second lookup
Line and Column Chart
Format Label Font and Background color เพื่อเพิ่มความแตกต่าง
Focus Mode อยู่มุมขวาบนของทุก Visual/Chart
ตอนกลับก็ Back to report
หากเราจำเป็นต้องเอา Excel ของชาวบ้าน หรือ ระบบหลัก มาตัดต่อ แก้ไข ทำความสะอาด ปรับปรุงให้มาอยู่ในรูปแบบที่เราต้องการ เพื่อเอาไปออกรายงาน หรือต่อยอดด้วยข้อมูลของเรา เมื่อก่อนเราต้องเขียน Macro กันอุตลุด ต้องเป็นเทพเป็นเซียนถึงจะทำได้ ซึ่งห่างไกลเกินฝันสำหรับนัก Excel ธรรมดามาก หนำซ้ำต้องทำอย่างนั้นทุกครั้งๆ ที่ต้องการออกรายงานซึ่งเป็นงานที่ยากเย็นแสนเข็ญ กินเวลาสุดๆ
ปัจจุบัน คน Excel ธรรมดา เขียน Macro ได้ด้วยการ click click ลากๆ วางๆ ด้วย Power BI Desktop อันเป็นตัวฟรี ที่ Microsoft แจกให้ต่อยอด Excel อย่างมันส์ ๆ ไม่ต้องเก่งก็ทำได้ง่ายๆ
ลดงานซ้ำซ้อนต่างคนต่างทำได้เวลากลับคืนมาจุกๆ แถมความผิดจากการลอกพลาดตำเตี้ยเรี่ยดินอีกต่างหาก