<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Microsoft Power BI 彙整 &#8211; Sharon Lab∣雪倫實驗室</title>
	<atom:link href="https://aderlab.com/data-analytics/microsoft-power-bi/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>數據分析師的工作日常與職場點滴</description>
	<lastBuildDate>Sat, 25 Mar 2023 07:31:22 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/aderlab.com/wp-content/uploads/cropped-sharons-lab-logo-1.png?fit=32%2C32&#038;ssl=1</url>
	<title>Microsoft Power BI 彙整 &#8211; Sharon Lab∣雪倫實驗室</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">164707546</site>	<item>
		<title>Power BI v.s. Tableau：數據新手該學哪個 BI 工具比較好？</title>
		<link>https://aderlab.com/data-analytics/power-bi-tableau-which-one-is-better/</link>
		
		<dc:creator><![CDATA[Sharon]]></dc:creator>
		<pubDate>Sat, 25 Mar 2023 01:00:00 +0000</pubDate>
				<category><![CDATA[Microsoft Power BI]]></category>
		<category><![CDATA[Tableau]]></category>
		<category><![CDATA[數據分析]]></category>
		<guid isPermaLink="false">https://aderlab.com/?p=4756</guid>

					<description><![CDATA[<p>去年開始分享 Microsft Power BI 後，陸續被問到「建議新手學習 Power BI 還是 Tableau 呢？」、「 Power BI 跟 Tab&#8230;</p>
<p><a href="https://aderlab.com/data-analytics/power-bi-tableau-which-one-is-better/" class="btn-continue">繼續閱讀<span class="arrow-continue">&#8594;</span></a></p>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-tableau-which-one-is-better/">Power BI v.s. Tableau：數據新手該學哪個 BI 工具比較好？</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>去年開始分享 Microsft Power BI 後，陸續被問到「建議新手學習 Power BI 還是 Tableau 呢？」、「 Power BI 跟 Tableau 比較推薦使用哪一個？ 」這些問題，於是便有了這篇文章的靈感。</p>



<p>這篇文章來分享我使用兩個工具最有感的使用差異，也會分享如何透過提問，讓你找到現階段適合自己優先學習的工具，如果你陷入選擇焦慮，不妨可以看看這篇文章的分享，相信就能找到適合學習的視覺化工具了[註1]。</p>



<h2 class="wp-block-heading">以個人經驗比較 Power BI 與 Tableau 的使用差異</h2>



<p>我實際使用兩個工具的心得是，如果你只是做個人作品或是自主練習，那不論是免費版 POWER BI  還是 Tableau Public （Tableau 免費版的產品名稱，以下簡稱：Tableau）其實都可以，兩個工具都能做出非常好看、具實用性的互動式報表[註2]。兩個工具雖然在系統面、價格面、串接資料廣度上都略有差異，但就個人使用的角度來說，完全不影響個人使用或是數據作品呈現，因為個人使用的情境相對單純，一來是資料量通常不大，二來是資料源大多以 Excel、CSV或簡易的資料庫為主，串接資料源也不太會有問題，所以，這篇文章不做規格、系統、資料源等硬體規格上的比較，我想以使用者的角度切入，分享實際使用過程中，兩個工具在功能面、介面當中的差異。</p>



<ol class="wp-block-list">
<li>資料預處理 <br>Power BI 的一大優勢就是可以做到簡單的資料清理， Power BI 這個工具是從 Excel 的小功能逐步擴展功能到建立起一套獨立商業智能分析工具，他也挾帶著 Excel 的功能優勢：Power Query，匯入資料後就能在內建的 Power Query 介面進行資料處理與欄位新增、刪除與編輯。而相對來說，Tableau 更強調視覺化與數據分析，所以在匯入資料前就需要先做完資料處理，才能在 Tableau 上分析使用。<br><br></li>



<li>視覺化顏色差異 <br>Tableau 的內建顏色色階、調色盤我認為是更好看以及友善一些，所以我之前在做兩個工具各自的數據作品集時，我很輕易用 Tableau 預設顏色以及色階就能做出很好看的顏色搭配，而 Power BI 的預設顏色我則覺得沒有太特別好看，我還另外花了點時間去找顏色色階來設計，如果你是更在意顏色跟美感的，或是不擅長自己配色，也許 Tableau 會更適合你一些。<br><br></li>



<li>公式邏輯差異 <br>雖然兩個工具都有運算式，但是公式邏輯跟寫法差距很大，Power BI 的話是用 DAX，Tableau 則是函式，千萬不要以為熟悉了一個工具的公式，另外一個工具就能上手的很快，並沒有這回事。<br>Power BI 我認為是相對好上手，畢竟 Power BI 跟 Excel 一樣都是 Microsoft 體系的產品，雖然不完全與 Excel 的公式一模一樣，但是相似程度很高，所以如果非常熟悉 Excel 公式的話，上手 DAX 公式會相對容易；而 Tableau 的整體公式我認為更複雜，特別是詳細階層運算式的應用，不過使用上也比較彈性，也能搭配集合、篩選器的篩選順序、參數設計等達到複雜的計算與篩選成果。<br></li>
</ol>



<h2 class="wp-block-heading">該選 Power BI 還是 Tableau 學習呢？</h2>



<p>說了這麼多 Power BI 還是 Tableau 使用的差異性，你可能還是不知道到底該選 Power BI 還是 Tableau 呢？我的建議是，學習工具前，都先問問自己這個核心問題：「學這個工具想要達到的目的是什麼？」</p>



<p>假設你學這個工具的目的是做出一份自己的互動式報表作品集，那挑哪一個工具學習都可以，因為重點是作品呈現什麼數據、你用哪些視覺化圖表、你怎麼設計報表以及你想透過這份作品「說什麼故事」，故事才是重點，使用什麼工具並不重要。</p>



<p>假設你想要仰賴「學工具」找到一份工作或是拿到一個實習機會，那挑選學習工具的邏輯就完全不一樣，就是看你想要應徵的公司到底使用哪個工具，這個答案公司的Job Description 會告訴你。當然啦，還有一種實務上常常會遇到的狀況，就是你很明確的知道，學這個視覺化工具就是想應徵某個公司，卻發現 Job Description 要求的能力要求了「擅長 Power BI 或 Tableau 」，又或者，你想要面試的公司不只一家，一家要求使用 Power BI ，另外一家又要求要會 Tableau 那怎麼辦？遇到這種狀況，如果你行有餘力能兩個都學當然最好，但如果不行，我就建議先看看市面上哪個工具最能幫助你投出最多份履歷吧！例如你總共有10家公司想要投履歷，其中 7 家要求 Tableau 的技能，其中 3 家要求 Power BI 的技能，那麼我一定會建議先把 Tableau 學起來。</p>



<p>而如果是我，我自己則有另外一種作法，<strong>那就是兩個都學，但只求兩個工具學到能只做一份作品出來就好</strong>。意思是，我不求這兩個工具都要學到爐火純青，但我得花最少的時間，不論是臨摹別人的分析作品，或是從上課的作業作品稍做修改，只要證明我會使用視覺化工具，這樣就足夠了！</p>



<p>誰說工具一定要用到大師級才可以去應徵？誰說課程一定要上好上滿才能投履歷？這樣一來，我就可以同時應徵要求 Tableau 技能以及 Power BI 技能的公司了，相信我，做作品集呈現的人真的很少，先願意做，做出來，就已經贏了一半以上的競爭者了。</p>



<p>延伸閱讀：<a href="https://aderlab.com/job/interview-profile/" target="_blank" rel="noreferrer noopener">數據分析師的作品集怎麼做？分享我實際作品與準備方式</a></p>



<p>除了上述兩種常見的學習目的外，我也提供以下3個可以幫助你評估到底該學哪一個工具的問題：</p>



<ol class="wp-block-list">
<li>你的電腦是 Mac 還是 Windows 呢？ <br>如果你的電腦是 Mac 的話，那就只能使用 Tableau，因為 Power BI 電腦版只支援 Windows 系統，相反的，如果你的電腦是 Windows 的話，那麼 Power BI 或 Tableau 都可以選擇。<br><br></li>



<li>你想做的資料分析有機密性嗎？ <br>如果你的資料有機密性，不適合公開發佈，那 Power BI 會更適合你。原因是因為 Power BI 的免費版就可以儲存在自己的桌機上，但 Tableau 就一定要公開發佈，所以機密的資料就不適用使用 Tableau Public了。<br><br></li>



<li>你的資料需不需要預處理 <br>你的資料是乾淨嗎？還是數據分析前還需要先做資料處理的呢？如果你的狀況是後者，那麼 Power BI 的免費版本會更符合需求，因為 Power BI 的免費版就有 Power Query 的功能，而在資料匯入後，就可以用 Power Query 做到資料合併、新增欄位、欄位計算，解樞紐等資料處理功能。至於 Tableau 則著重的是資料匯入之後的視覺化呈現，就沒有對應的資料處理功能。</li>
</ol>



<p>這篇關於 Power BI 跟 Tableau 的比較分享就分享到這裡啦，希望對你評估該選哪個工具學習有幫助，我們下篇文章見～</p>



<p>[註1] 這篇只談 Power BI 以及 Tableau ，不納入 Looker Studio (前身為 Google Data Studio) 比較，因為實際上數據分析師的工作多半還是以 Power BI 以及 Tableau 這兩大工具為主，所以就僅比較這兩個工具差異。</p>



<p>[註2] Tableau 跟 Power BI 都有可以看到別人設計模板的公開網站（<a href="https://public.tableau.com/app/discover" target="_blank" rel="noreferrer noopener nofollow">Tableau 探索 </a>、<a href="https://community.powerbi.com/t5/Data-Stories-Gallery/bd-p/DataStoriesGallery" target="_blank" rel="noreferrer noopener nofollow">Power BI Gallery</a>），仔細看看別人公開發佈的作品會發現，不論是用 Power BI 還是 Tableau，都可以做出非常相似的視覺化效果。</p>



<p class="has-text-align-right">Sharon</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide"/>



<p class="has-medium-font-size"><strong>Buy me a coffee&nbsp; 用行動支持我的內容創作</strong></p>



<p><em>如果我的文章對你有幫助，歡迎用行動支持我的內容創作，小額贊助請我喝咖啡、留言或是寄信來跟我分享你的收穫，都會讓我持續有動力分享更多內容唷～</em></p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button aligncenter is-style-fill"><a class="wp-block-button__link has-black-color has-luminous-vivid-amber-background-color has-text-color has-background wp-element-button" href="https://www.buymeacoffee.com/aderlabsharon" target="_blank" rel="noreferrer noopener">以小額贊助支持Sharon</a></div>
</div>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-tableau-which-one-is-better/">Power BI v.s. Tableau：數據新手該學哪個 BI 工具比較好？</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4756</post-id>	</item>
		<item>
		<title>POWER BI 圖表類型與應用場景：用圓餅圖、瀑布圖與樹狀圖分析客戶</title>
		<link>https://aderlab.com/data-analytics/power-bi-chart-2/</link>
		
		<dc:creator><![CDATA[Sharon]]></dc:creator>
		<pubDate>Sun, 18 Dec 2022 08:17:28 +0000</pubDate>
				<category><![CDATA[Microsoft Power BI]]></category>
		<category><![CDATA[數據分析]]></category>
		<guid isPermaLink="false">https://aderlab.com/?p=4476</guid>

					<description><![CDATA[<p>延續上一篇：POWER BI 圖表類型與應用場景：KPI卡片、資料表、長條圖與折線圖，這一篇持續來分享POWER BI 裡面的常用數據圖表，這篇以客戶分析...</p>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-chart-2/">POWER BI 圖表類型與應用場景：用圓餅圖、瀑布圖與樹狀圖分析客戶</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>延續上一篇：<a href="https://aderlab.com/data-analytics/power-bi-chart-1/">POWER BI 圖表類型與應用場景：KPI卡片、資料表、長條圖與折線圖</a>，這一篇持續來分享POWER BI 裡面的常用數據圖表，這篇以客戶分析的角度出發，分享這些圖表可以如如何在客戶分析上派上用場。</p>



<p>資料使用客戶消費的訂單資料，這篇文章將分享如何透過數據圖表來回答以下幾件問題：</p>



<ol class="wp-block-list">
<li>公司的客戶組成長什麼樣子？哪些是對業績貢獻度最高的族群？</li>



<li>從2013年到2015年，消費會員數是增加還是衰退，是哪些族群增加或衰退呢？</li>
</ol>



<h2 class="wp-block-heading">用圓餅圖了解現況客戶組成</h2>



<p>第一個問題：2015年公司的客戶組成長什麼樣子？哪些是對業績貢獻度最高的族群？回答這個問題先從了解現況客戶組成開始，初步分析從新客與舊客的角度出發，第一次消費的客人歸類成新客，消費過兩次以上，含兩次的客人定義為舊客。透過三個年度的圓餅圖可以發現，2015年的新舊客消費狀況，兩個族群的消費額占比差異不大，大約是55分佈的狀態，不過如果再加上2013年和2014年的新客消費佔比來看，很明顯的可以看到新客的消費金額占比從2013年營收占比的77.21％、2014年降到63.61%，2015年則消費金額占比則首度低於舊客的整體消費金額。</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/2015.png?ssl=1"><img data-recalc-dims="1" fetchpriority="high" decoding="async" width="708" height="727" src="https://i0.wp.com/aderlab.com/wp-content/uploads/2015.png?resize=708%2C727&#038;ssl=1" alt="" class="wp-image-4480" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/2015.png?w=758&amp;ssl=1 758w, https://i0.wp.com/aderlab.com/wp-content/uploads/2015.png?resize=292%2C300&amp;ssl=1 292w" sizes="(max-width: 708px) 100vw, 708px" /></a></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full is-resized"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/2014.png?ssl=1"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/aderlab.com/wp-content/uploads/2014.png?resize=285%2C256&#038;ssl=1" alt="" class="wp-image-4481" width="285" height="256" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/2014.png?w=874&amp;ssl=1 874w, https://i0.wp.com/aderlab.com/wp-content/uploads/2014.png?resize=300%2C270&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/2014.png?resize=768%2C691&amp;ssl=1 768w" sizes="(max-width: 285px) 100vw, 285px" /></a></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/2013.png?ssl=1"><img data-recalc-dims="1" decoding="async" width="708" height="717" src="https://i0.wp.com/aderlab.com/wp-content/uploads/2013.png?resize=708%2C717&#038;ssl=1" alt="" class="wp-image-4482" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/2013.png?w=796&amp;ssl=1 796w, https://i0.wp.com/aderlab.com/wp-content/uploads/2013.png?resize=296%2C300&amp;ssl=1 296w, https://i0.wp.com/aderlab.com/wp-content/uploads/2013.png?resize=768%2C778&amp;ssl=1 768w" sizes="(max-width: 708px) 100vw, 708px" /></a></figure>
</div>
</div>



<p>新客消費金額占比持續下降是不是一件壞事？只看消費金額占比的變化不太能直接下定論，還需要搭配其他指標以及公司的發展策略搭配來判斷。以這份數據的新舊客消費來看，第一個可以加入判斷的數據指標是新客消費的實際消費金額，2013年新客消費金額是$2,067,359，2014年新客消費金額是$2,166,319，2015年新客消費金額則是$2,171,377，看到這個數據我們就知道，新客的消費金額占比雖然下降，但實際消費金額卻沒有降低，新客消費金額佔比降低只是是因為舊客的消費金額也是逐年度的增加，所以整體來說並不是一個壞的數據徵兆。</p>



<p>特意舉這個例子也是想分享，圓餅圖雖然有助於讓我們看到資料組成狀況，但是在跨年度的趨勢比較上，比例的降低或提高都沒辦法讓我們做出合適的數據判斷，反而有可能誤導我們，如果要了解數據趨勢變化，更建議使用用實際的數字比較。知道目前新舊客的消費金額佔比差不多之後，接下來我們就需要更深入的去了解實際的消費人數變化，以及未來在新客與舊客的消費現況，以利我們未來針對不同族群做出更合適的策略方針。</p>



<h2 class="wp-block-heading">以瀑布圖看出年度消費人數增長</h2>



<p>消費人數、消費金額以及消費頻次大多是企業營收的關鍵指標之一，所以接下來我往下針對新舊客在近幾年的人數變化，讓我們掌握現況整體消費會員的消費狀況，包括：我們的商品是不是持續有想要購買的客群？舊客會不會持續購買我們的商品？我們的商品能不能吸引到新的客人來購買等。</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="607" src="https://i0.wp.com/aderlab.com/wp-content/uploads/%E6%88%AA%E5%9C%96-2022-11-20-%E4%B8%8B%E5%8D%884.47.24.png?resize=708%2C607&#038;ssl=1" alt="" class="wp-image-4484" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/%E6%88%AA%E5%9C%96-2022-11-20-%E4%B8%8B%E5%8D%884.47.24.png?w=802&amp;ssl=1 802w, https://i0.wp.com/aderlab.com/wp-content/uploads/%E6%88%AA%E5%9C%96-2022-11-20-%E4%B8%8B%E5%8D%884.47.24.png?resize=300%2C257&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/%E6%88%AA%E5%9C%96-2022-11-20-%E4%B8%8B%E5%8D%884.47.24.png?resize=768%2C659&amp;ssl=1 768w" sizes="auto, (max-width: 708px) 100vw, 708px" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="618" src="https://i0.wp.com/aderlab.com/wp-content/uploads/old-customer-change.png?resize=708%2C618&#038;ssl=1" alt="" class="wp-image-4485" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/old-customer-change.png?w=772&amp;ssl=1 772w, https://i0.wp.com/aderlab.com/wp-content/uploads/old-customer-change.png?resize=300%2C262&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/old-customer-change.png?resize=768%2C671&amp;ssl=1 768w" sizes="auto, (max-width: 708px) 100vw, 708px" /></figure>
</div>
</div>



<p>從瀑布圖我們可以看出新舊客每年持續都有成長，不過除了絕對的數字有成長，我們也需要關心成長率的成長趨勢。</p>



<p>以新客成長為例，2012年到2013年成長31位，成長率0.74%，2013年到2014年成長226位，成長率5.39%，2014年到2015年成長215位，成長率4.86%，雖然都有成長，但是可以看到成長率比起2014年的成長率低，就需要注意新客的成長可能性是否已經進去平緩的趨勢，如果逐漸平緩，是因為目前的行銷策略都指觸及到同一群人嗎？是不是需要用不同的溝通渠道擴展新客呢？又或者，現在新客增加比率趨緩，是因為市場已經飽和了嗎？是不是要往新的產品品項或是對象來拓展新客市場。</p>



<p>而在舊客方面，比起舊客人數的增加，舊客經營更需要重視的是流失率以及回購頻率與回購率，也就是我們的產品、溝通，有沒有辦法持續符合客人的需求，這也是持續讓企業獲利的重要關鍵之一。</p>



<h2 class="wp-block-heading">用樹狀圖區看客戶分群</h2>



<p>客戶分析回歸到分析的目的，其實都是希望可以創造更多的營業收入，創造營業收入的方向不外乎是：增加更多願意購買商品的人、增加購買的頻率，例如說一年原本都只買一次，我們用一些方法，讓客戶願意買兩次、買三次，甚至是更多。又或者，提高每次客人願意購買商品的數量以提升客單價等，所以客戶分析到最後，我們還是需要提出行動方案來測試，看看哪種行動可以最大化營收。</p>



<p>不過客戶百百種，想要單仰賴一招打天下，擄獲所有客戶的心是很困難的，這也是為什麼我們需要做客戶分群溝通。客戶分群的方式有非常多種，例如可以以購買產品類型作為分群，例如說都購買3C商品的客人一類、都購買傢俱類型的客人一類；或者可以以消費習慣分群，分析哪些客人可能是有大量採買的家庭需求，哪些客人可能更需要的是小份量的商品組合等；又或者，以客戶的消費習慣跟階段分群也是一種方式，例如說著名的RFM模型、NES模型等，都是常見用來客戶分群的方式。</p>



<p>這邊就先以RFM模型來舉例，RFM模型簡單說就是將客戶的消費頻率<strong>（</strong>requency）、消費金額（<strong>m</strong>onetary）以及最近一次消費的距今天數（recency）做分類，區分成8種客戶類型，消費頻率愈高、消費金額愈高以及消費天數距今天數愈近，對於企業來說愈是重要的VVIP，相對的，這個分群也可以讓我們找到一些過去消費金額高、消費頻次高，但可能最近都沒有來購買的客人，這群快要流失的客人，也可以讓我們找到這群人，接著想辦法提醒他們回購。</p>



<figure class="wp-block-image size-full is-resized"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/aderlab.com/wp-content/uploads/RFM-2.png?resize=681%2C564&#038;ssl=1" alt="" class="wp-image-4487" width="681" height="564" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/RFM-2.png?w=908&amp;ssl=1 908w, https://i0.wp.com/aderlab.com/wp-content/uploads/RFM-2.png?resize=300%2C248&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/RFM-2.png?resize=768%2C636&amp;ssl=1 768w" sizes="auto, (max-width: 681px) 100vw, 681px" /></figure>



<p>分群過後，我們可以把不同族群的會員人數以樹狀圖的方式呈現，也能很輕易地看出目前哪些族群的人數佔比最高，可以從人數佔比最高的開始提出行動方案，當然，也可以從快流失的客群的方向著手，最終的目的都是希望透過檢視目前客戶的消費行為與狀態，規劃出適合的喚醒策略。</p>



<p>那今天這篇從客戶分析角度出發的分享就分享到這裡啦，希望能給大家一點新想法，我們下篇文章見～</p>



<p class="has-text-align-right">Sharon</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide"/>



<p class="has-medium-font-size"><strong>Buy me a coffee&nbsp; 用行動支持我的內容創作</strong></p>



<p><em>如果我的文章對你有幫助，歡迎用行動支持我的內容創作，小額贊助請我喝咖啡、留言或是寄信來跟我分享你的收穫，都會讓我持續有動力分享更多內容唷～</em></p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button aligncenter is-style-fill"><a class="wp-block-button__link has-black-color has-luminous-vivid-amber-background-color has-text-color has-background wp-element-button" href="https://www.buymeacoffee.com/aderlabsharon" target="_blank" rel="noreferrer noopener">以小額贊助支持Sharon</a></div>
</div>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-chart-2/">POWER BI 圖表類型與應用場景：用圓餅圖、瀑布圖與樹狀圖分析客戶</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4476</post-id>	</item>
		<item>
		<title>POWER BI 圖表類型與應用場景：KPI卡片、資料表、長條圖與折線圖</title>
		<link>https://aderlab.com/data-analytics/power-bi-chart-1/</link>
		
		<dc:creator><![CDATA[Sharon]]></dc:creator>
		<pubDate>Sun, 13 Nov 2022 01:00:00 +0000</pubDate>
				<category><![CDATA[Microsoft Power BI]]></category>
		<category><![CDATA[數據分析]]></category>
		<guid isPermaLink="false">https://aderlab.com/?p=4429</guid>

					<description><![CDATA[<p>這一篇想來分享在 POWER BI 裡面可以常用的視覺化圖表，包括：資料卡片、矩陣表、長條圖與折線圖。這些圖表大家絕對不陌生，但如何在 POWER BI 裡應用&#8230;</p>
<p><a href="https://aderlab.com/data-analytics/power-bi-chart-1/" class="btn-continue">繼續閱讀<span class="arrow-continue">&#8594;</span></a></p>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-chart-1/">POWER BI 圖表類型與應用場景：KPI卡片、資料表、長條圖與折線圖</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>這一篇想來分享在 POWER BI 裡面可以常用的視覺化圖表，包括：資料卡片、矩陣表、長條圖與折線圖。這些圖表大家絕對不陌生，但如何在 POWER BI 裡應用，讓我們能做出一份具有分析意義的數據報告呢？這一篇文章將從實際營收數據出發，分享如何用這些圖表，回答常見的商業問題，那就開始囉！</p>



<p>這一篇文章將使用2012年到2015年的訂單資料，我想透過訂單的數據分析，回答以下幾個問題：</p>



<ol class="wp-block-list">
<li>2015年的營業額目標是500萬，毛利額目標是50萬，兩項指標是否有達標？如果沒有達標的話，有什麼方法可以改善？</li>



<li>哪些產品是2015年營收最高的產品？哪些產品是2015年營收最低的產品？</li>



<li>有哪個產品類別是值得重點發展的商品？哪些商品又是需要重點觀測的商品呢？</li>
</ol>



<h2 class="wp-block-heading">KPI與卡片：掌握總體數據</h2>



<p>第一個問題是所有業績檢視環節都會想知道的資訊，那就是公司到底整年度有多少收入？有多少毛利額？（更多時候會計算到淨利是多少，但這份資料僅有利潤資料，所以先分析到毛利額）</p>



<p>在看總體資料的時候，最適合使用的就是POWER BI 裡面的卡片以及KPI的視覺效果。兩者的差別在於，當我們想看趨勢或是看目標有沒有達成的時候，KPI這項視覺效果會更適合，但如果我們只需要知道總體營收數字，不需要做任何比較的話，那麼卡片的呈現就非常足夠了！</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/card_type.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="371" src="https://i0.wp.com/aderlab.com/wp-content/uploads/card_type.png?resize=708%2C371&#038;ssl=1" alt="" class="wp-image-4457" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/card_type.png?resize=1024%2C536&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/card_type.png?resize=300%2C157&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/card_type.png?resize=768%2C402&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/card_type.png?resize=1536%2C804&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/card_type.png?resize=2048%2C1072&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/card_type.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/card_type.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>今天我想知道營業額以及毛利額有沒有達到設定的目標，所以就選擇使用KPI的卡片，接著設定KPI卡片的資料，包括：值、趨勢軸以及趨勢（這邊的趨勢其實就是目標的意思），最後就會出現一個總計的值，告訴我們2015年一整年的營業額是4,299,866，沒有達到營業額目標，與目標業績差距14%的圖卡。</p>



<p>毛利額的作法也一樣，把相關的欄位拉選好欄位之後，就可以看到是否達標，以毛利額來說，毛利額就達到了目標，所以系統預設以綠色文字搭配小勾勾呈現，如下圖所示。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/kpi_card.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="319" src="https://i0.wp.com/aderlab.com/wp-content/uploads/kpi_card.png?resize=708%2C319&#038;ssl=1" alt="" class="wp-image-4458" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/kpi_card.png?resize=1024%2C461&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/kpi_card.png?resize=300%2C135&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/kpi_card.png?resize=768%2C346&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/kpi_card.png?resize=1536%2C691&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/kpi_card.png?resize=2048%2C922&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/kpi_card.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/kpi_card.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>當我們使用KPI或是卡片呈現數字的時候，最大的好處是立刻知道總計數據，但相對的，缺點是我們沒辦法單用這個資訊知道達標與否的原因是什麼，所以看完總體營收資料，接下來我們就需要往下以不同維度來分析訂單的營業額從哪裡來。</p>



<p>以什麼面向延伸分析沒有標準答案，方向取決於你數據服務的單位是哪個單位，或是公司想以什麼面向先進行檢討改進，例如說：以產品的角度分析：是哪些產品沒有達到營收目標？為什麼沒有達到營收目標？是對於產品的需求預估與市場需求有差異？整體市場消費萎縮？或是整體行銷宣傳不足嗎？</p>



<p>以市場的角度分析：是哪些市場未達到營收目標？這些市場的行銷怎麼樣？通路渠道銷售狀況怎麼樣？</p>



<p>以客戶的角度分析：以這家公司來說，客戶就分成個體消費者、公司戶以及家居辦公的三種類型，客戶消費上哪些族群的消費力度和我們預期的營收目標有落差？</p>



<p>雖然有不同的分析角度，但唯一不變的是，我們都需要鎖定一個想要解決或是了解的方向，然後以那個方向需要的維度深入看看數據的組成與分佈，從中找到問題或是機會點。</p>



<h2 class="wp-block-heading">資料表與矩陣表：呈現完整資料</h2>



<p>第二個要分享的是資料表與矩陣表，用這種方式呈現資料可以補足一部分KPI或是卡片沒辦法呈現的「多維度資料面向」，呈現詳細的資料組成，例如說我可以把營業額的資料展開，變成完整呈現每個市場的營業額，以及和營收相關的各種數據，像是利潤、毛利率與銷售數量等數據資料。</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/table-origin.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="268" src="https://i0.wp.com/aderlab.com/wp-content/uploads/table-origin.png?resize=708%2C268&#038;ssl=1" alt="" class="wp-image-4439" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/table-origin.png?w=840&amp;ssl=1 840w, https://i0.wp.com/aderlab.com/wp-content/uploads/table-origin.png?resize=300%2C114&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/table-origin.png?resize=768%2C291&amp;ssl=1 768w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>雖然矩陣表與資料表可以呈現詳細的數據，但是詳細的數據有時候未必是好事，特別是當我們想要一眼看出數據多寡差異的時候，過於詳細的數字比較容易讓人眼花撩亂，這也是資料表會有的缺點。面對這個缺點我們可以有兩種解決辦法，第一種解決辦法是搭配其他圖表輔助呈現，這個我後續會分享更多可以使用的圖表，另一種就是在資料表建立格式化的條件來標注表格重點。</p>



<p>在 POWER BI 裡面有五種可以選擇的資料標註，可以在背景或文字更換顏色、建立資料橫條、圖示或是新增URL，讓我們能強調想要重點溝通的資料重點。</p>



<div class="wp-block-jetpack-tiled-gallery aligncenter is-style-columns"><div class="tiled-gallery__gallery"><div class="tiled-gallery__row"><div class="tiled-gallery__col" style="flex-basis:34.64071%"><figure class="tiled-gallery__item"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/table-visualization-2.png?ssl=1"><img decoding="async" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/table-visualization-2.png?strip=info&#038;w=600&#038;ssl=1 600w,https://i0.wp.com/aderlab.com/wp-content/uploads/table-visualization-2.png?strip=info&#038;w=744&#038;ssl=1 744w" alt="" data-height="902" data-id="4441" data-link="https://aderlab.com/?attachment_id=4441" data-url="https://aderlab.com/wp-content/uploads/table-visualization-2.png" data-width="744" src="https://i0.wp.com/aderlab.com/wp-content/uploads/table-visualization-2.png?ssl=1" data-amp-layout="responsive"/></a></figure></div><div class="tiled-gallery__col" style="flex-basis:34.64071%"><figure class="tiled-gallery__item"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/table-visualizations.png?ssl=1"><img decoding="async" srcset="https://i2.wp.com/aderlab.com/wp-content/uploads/table-visualizations.png?strip=info&#038;w=600&#038;ssl=1 600w,https://i2.wp.com/aderlab.com/wp-content/uploads/table-visualizations.png?strip=info&#038;w=744&#038;ssl=1 744w" alt="" data-height="902" data-id="4443" data-link="https://aderlab.com/?attachment_id=4443" data-url="https://aderlab.com/wp-content/uploads/table-visualizations.png" data-width="744" src="https://i2.wp.com/aderlab.com/wp-content/uploads/table-visualizations.png?ssl=1" data-amp-layout="responsive"/></a></figure></div><div class="tiled-gallery__col" style="flex-basis:30.71857%"><figure class="tiled-gallery__item"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/table-visualization-3.png?ssl=1"><img decoding="async" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/table-visualization-3.png?strip=info&#038;w=600&#038;ssl=1 600w,https://i0.wp.com/aderlab.com/wp-content/uploads/table-visualization-3.png?strip=info&#038;w=680&#038;ssl=1 680w" alt="" data-height="930" data-id="4442" data-link="https://aderlab.com/?attachment_id=4442" data-url="https://aderlab.com/wp-content/uploads/table-visualization-3.png" data-width="680" src="https://i0.wp.com/aderlab.com/wp-content/uploads/table-visualization-3.png?ssl=1" data-amp-layout="responsive"/></a></figure></div></div></div></div>



<p>舉例來說，我想在資料上呈現每個市場的銷售額高低，那我就可以使用資料橫條的功能，讓資料表不僅呈現數字，還可以依照數字高低呈現資料橫條圖，這樣營收高低立刻就看出來了！</p>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/table-bar.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="252" src="https://i0.wp.com/aderlab.com/wp-content/uploads/table-bar.png?resize=708%2C252&#038;ssl=1" alt="" class="wp-image-4431" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/table-bar.png?w=994&amp;ssl=1 994w, https://i0.wp.com/aderlab.com/wp-content/uploads/table-bar.png?resize=300%2C107&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/table-bar.png?resize=768%2C274&amp;ssl=1 768w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>除了資料橫條之外，資料圖示也是我經常使用的功能，舉個例子來說，如果對於這家公司來說毛利率低於10%就會非常危險，那麼我就可以針對毛利率低於10%設定警告圖示，所以當資料表有低於10%的狀況出現，那我一樣可以立刻知道哪些銷售市場需要注意，甚至是深入挖掘毛利率低的原因。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/table-marker-1.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="411" src="https://i0.wp.com/aderlab.com/wp-content/uploads/table-marker-1.png?resize=708%2C411&#038;ssl=1" alt="" class="wp-image-4444" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/table-marker-1.png?resize=1024%2C595&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/table-marker-1.png?resize=300%2C174&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/table-marker-1.png?resize=768%2C447&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/table-marker-1.png?w=1142&amp;ssl=1 1142w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>最後分享一個從資料表也能簡單看出數據趨勢的功能，那就是「新增走勢圖」，這個功能可以讓我們設定小要呈現趨勢的時間軸，然後選定資料表裡的其中一個指標，讓我們看出數據增長情況趨勢走向。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/table-trend.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="319" src="https://i0.wp.com/aderlab.com/wp-content/uploads/table-trend.png?resize=708%2C319&#038;ssl=1" alt="" class="wp-image-4445" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/table-trend.png?resize=1024%2C461&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/table-trend.png?resize=300%2C135&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/table-trend.png?resize=768%2C345&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/table-trend.png?w=1356&amp;ssl=1 1356w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<h2 class="wp-block-heading">長條圖：呈現多維資料分析</h2>



<p>說完資料表，接著來談談長條圖，常常用來比較資料的高低多寡，例如不同銷售地區的產品銷售數量、營收高低，我們可以輕易的用長條圖來呈現數據的高低。</p>



<p>回到一開始的問題，長條圖就可以告訴我們：哪些產品是2015年營收最高的產品？哪些產品是2015年營收最低的產品？比較簡單粗暴的方法是直接把產品名稱放到長條圖的X軸、營業額放到Y軸，然後看哪個產品的營收比較高。</p>



<p>但現實總是沒有這麼容易，當公司的產品數量超過20個品項以上，又有不同產品類別的時候，當我們一展開產品銷售的長條圖，就會像下圖一樣密密麻麻，什麼資訊都判斷出來。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/bar-sample-1.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="298" src="https://i0.wp.com/aderlab.com/wp-content/uploads/bar-sample-1.png?resize=708%2C298&#038;ssl=1" alt="" class="wp-image-4462" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/bar-sample-1.png?resize=1024%2C431&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/bar-sample-1.png?resize=300%2C126&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/bar-sample-1.png?resize=768%2C323&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/bar-sample-1.png?resize=1536%2C646&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/bar-sample-1.png?w=1964&amp;ssl=1 1964w, https://i0.wp.com/aderlab.com/wp-content/uploads/bar-sample-1.png?w=1416&amp;ssl=1 1416w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>所以，當我們遇到產品品項非常多的時候，一種做法就是把商品做分類，例如說手機的商品一類、書櫃一類、桌子一類、飾品一類等，先看產品種類對於公司營業額的佔比，接著再針對想要深入了解的產品種類進行資料展開跟向下挖掘。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/bar-sample-2.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="420" src="https://i0.wp.com/aderlab.com/wp-content/uploads/bar-sample-2.png?resize=708%2C420&#038;ssl=1" alt="" class="wp-image-4463" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/bar-sample-2.png?resize=1024%2C608&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/bar-sample-2.png?resize=300%2C178&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/bar-sample-2.png?resize=768%2C456&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/bar-sample-2.png?w=1102&amp;ssl=1 1102w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>進行產品分類之後，我們就可以看出在2015年的銷售當中，營業額最高的品項是手機，而業績最低的則是標籤。知道最高業績佔比跟最低業績的產品之後，我們還可以往下延伸做很多探勘。</p>



<p>例如說手機這個產品品項因為對於公司的整體業績很重要，所以未來在監測產品業績的時候，這個品項可能需要被重點觀察。又或者，針對業績佔比低的品項，也不是就放任不管，因為這些商品可能是新推出的商品或是未來需要重點發掘的商品，又或者其實這些佔比低的商品雖然現在業績不高，但也許他整體的成長趨勢是很可觀的，這些也都需要再針對不同的產品品類去一個一個把數據展開來看。</p>



<h2 class="wp-block-heading">折線圖：呈現資料趨勢</h2>



<p>最後，來談談折線圖，折線圖最主要用來呈現的就是數據的時間軸變化，例如說近5年的銷售額變化、客戶數的增長等，當我們想知道整體趨勢是往上、往下還是持平的時候，折線圖就可以清楚的讓我們掌握狀況，在 POWER BI 裡面，除了折線圖之外，區域圖跟緞帶圖也都有類似的功能，都可以讓我們看到數據的消長變化。</p>



<p>在數據消長對我來說非常重要的時候，我會更傾向使用緞帶圖，為什麼呢？可以看看下面兩張折線圖與緞帶圖的視覺化圖表。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/compare-line.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="221" src="https://i0.wp.com/aderlab.com/wp-content/uploads/compare-line.png?resize=708%2C221&#038;ssl=1" alt="" class="wp-image-4460" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/compare-line.png?resize=1024%2C319&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/compare-line.png?resize=300%2C94&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/compare-line.png?resize=768%2C239&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/compare-line.png?resize=1536%2C479&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/compare-line.png?w=1944&amp;ssl=1 1944w, https://i0.wp.com/aderlab.com/wp-content/uploads/compare-line.png?w=1416&amp;ssl=1 1416w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>上面這張圖是LATAM（拉丁美洲區域）在2014年到2015年的時候，銷售數量雖然有提升，但是首度被Europe（歐洲區域）以及USCA（美國加拿大區域）超越，當銷售數量與其他市場相比有小幅衰退的時候，緞帶圖會較明顯的呈現出不同市場的上升與下降狀況，而折線圖在小幅下降或是小幅的差異的狀況下，數據間的差異就相對不容易被凸顯出來。</p>



<p>回到最一開始的問題：哪個產品類別是值得重點發展的商品？哪些商品又是需要重點觀測的商品呢？要回答這個問題，一種切入的角度是，我們可以從產品的近5年營收成長率來看，市場對於產品的消費力趨勢怎麼樣。</p>



<p>一種作法是跟公司整體的營收成長率比較，例如說公司在2013年營收成長率是18.5%、2014年是27.20%、2015年是26.25%，那各產品種類的營收成長率有沒有連續三年都高於公司成長率的品項。又或者，可以用產品跟產品之間比較，例如說哪些產品持續成長，哪些產品可能在別的產品營收衰退的時候持續成長，這些趨勢都可以讓我們了解可能可以重點發展的未來之星是哪些產品。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/line-sample.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="604" src="https://i0.wp.com/aderlab.com/wp-content/uploads/line-sample.png?resize=708%2C604&#038;ssl=1" alt="" class="wp-image-4466" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/line-sample.png?resize=1024%2C873&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/line-sample.png?resize=300%2C256&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/line-sample.png?resize=768%2C655&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/line-sample.png?w=1274&amp;ssl=1 1274w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>以科技以科技類產品來看，科技類的營收成長率持續都有20多％的成長，Copiers影印機持續都比整個產品品類的營收成長率高，往下就可以看看市場是不是持續需要這個產品以及深度討論是否要成為公司的重點發展品項。</p>



<p>好啦，那POWER BI 的常用圖表就先分享到這裡，我們下篇文章見～</p>



<p class="has-text-align-right">Sharon</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide"/>



<p class="has-medium-font-size"><strong>Buy me a coffee&nbsp; 用行動支持我的內容創作</strong></p>



<p><em>如果我的文章對你有幫助，歡迎用行動支持我的內容創作，小額贊助請我喝咖啡、留言或是寄信來跟我分享你的收穫，都會讓我持續有動力分享更多內容唷～</em></p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button aligncenter is-style-fill"><a class="wp-block-button__link has-black-color has-luminous-vivid-amber-background-color has-text-color has-background wp-element-button" href="https://www.buymeacoffee.com/aderlabsharon" target="_blank" rel="noreferrer noopener">以小額贊助支持Sharon</a></div>
</div>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-chart-1/">POWER BI 圖表類型與應用場景：KPI卡片、資料表、長條圖與折線圖</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4429</post-id>	</item>
		<item>
		<title>5 個常見的 POWER BI 資料處理功能介紹（下篇）￼</title>
		<link>https://aderlab.com/data-analytics/power-bi-data-procedure-2/</link>
		
		<dc:creator><![CDATA[Sharon]]></dc:creator>
		<pubDate>Sat, 05 Nov 2022 01:00:00 +0000</pubDate>
				<category><![CDATA[Microsoft Power BI]]></category>
		<category><![CDATA[數據分析]]></category>
		<guid isPermaLink="false">https://aderlab.com/?p=4365</guid>

					<description><![CDATA[<p>延伸上一篇 5 個常見的 POWER BI 資料處理功能介紹（上篇）的資料處理功能介紹，這篇持續來介紹POWER BI 的資料處理功能，除了基本的資料空值處理外&#8230;</p>
<p><a href="https://aderlab.com/data-analytics/power-bi-data-procedure-2/" class="btn-continue">繼續閱讀<span class="arrow-continue">&#8594;</span></a></p>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-data-procedure-2/">5 個常見的 POWER BI 資料處理功能介紹（下篇）￼</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>延伸上一篇 <a href="https://aderlab.com/data-analytics/power-bi-data-procedure-1/">5 個常見的 POWER BI 資料處理功能介紹（上篇）</a>的資料處理功能介紹，這篇持續來介紹POWER BI 的資料處理功能，除了基本的資料空值處理外，這篇也會多分享資料合併、附加查詢以及檢查資料分佈情況的作法，那就開始囉！</p>



<h2 class="wp-block-heading">資料處理類型 1：附加查詢</h2>



<p>附加查詢最常用在合併兩份資料格式一樣，且欄位一樣的資料，什麼樣的資料會需要合併呢？當我們有兩份同樣的資料，但時間軸不一樣時，附加查詢的功能就能派上用場，例如以這份信用卡的資料為例，附加查詢就可以用來合併2020年與2021年的信用卡消費資料。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/merge-sample-1.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="425" src="https://i0.wp.com/aderlab.com/wp-content/uploads/merge-sample-1.png?resize=708%2C425&#038;ssl=1" alt="" class="wp-image-4406" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/merge-sample-1.png?resize=1024%2C615&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-sample-1.png?resize=300%2C180&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-sample-1.png?resize=768%2C461&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-sample-1.png?resize=1536%2C922&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-sample-1.png?resize=2048%2C1229&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-sample-1.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-sample-1.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>遇到這種需要合併兩份資料的狀況，有人可能會納悶，那我在匯入資料之前把A檔案的內容複製到B檔案不就好了嗎？沒錯，不過資料檔案少的時候當然可以使用複製貼上來合併資料，但是當資料檔案高達5份、10份的時候，附加查詢的功能就會幫助我們省下非常多的合併資料處理時間。</p>



<p>先把兩份我們想要合併在一起的資料匯入之後，選擇其中一份檔案，以信用卡資料為例，我先選擇了「信用卡消費資料_2020」，接著就可以按下「常用」選單裡面在右側的「附加查詢」。</p>



<p>附加查詢可以有兩種建立的方式，一種是直接「附加查詢」，意思是會在現在的資料把另外一份資料合併進來，所以原本的資料會受到影響。另外一種是「將查詢附加為新查詢」，則是會另外建立一個新的資料集，把現在畫面的資料，跟我們預期要合併的另外一份資料都獨立出來，變成一個新的資料集，自然也不影響原始的兩份資料。</p>



<p>沒有一定要使用哪一種方式，如果你需要保留兩份原始的資料後續使用，就可以選擇用「將查詢附加為新查詢」，如果有沒有原始的兩份資料對你來說沒差，那直接使用「附加查詢」也沒問題。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="395" src="https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button.png?resize=708%2C395&#038;ssl=1" alt="" class="wp-image-4407" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button.png?resize=1024%2C572&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button.png?resize=300%2C168&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button.png?resize=768%2C429&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button.png?resize=1536%2C858&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button.png?resize=2048%2C1144&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>接著選擇想要合併的資料，這個功能很貼心的會告訴你目前的資料是哪一份，所以在合併的時候就不會不小心選到原本的資料。最後按下右下角的「確定」就大功告成了。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/merge-choose.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="404" src="https://i0.wp.com/aderlab.com/wp-content/uploads/merge-choose.png?resize=708%2C404&#038;ssl=1" alt="" class="wp-image-4408" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/merge-choose.png?resize=1024%2C585&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-choose.png?resize=300%2C171&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-choose.png?resize=768%2C439&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-choose.png?resize=1536%2C878&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-choose.png?resize=2048%2C1170&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-choose.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-choose.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<figure class="wp-block-video"><video height="1750" style="aspect-ratio: 2868 / 1750;" width="2868" autoplay controls muted src="https://aderlab.com/wp-content/uploads/add-together.mov"></video></figure>



<p>關於不同時間軸的檔案合併方式，除了這邊操作的附加查詢外，我之前也有分享過如何用匯入整個資料夾的方式合併不同時間軸的檔案，可以參考這篇文章：<a href="https://aderlab.com/data-analytics/power-bi-auto-updating/" target="_blank" rel="noreferrer noopener">用 POWER BI 自動更新數據，解決重複性資料整理</a>。</p>



<p></p>



<h2 class="wp-block-heading">資料處理類型 2：空值處理</h2>



<p>將資料匯入 POWER BI 的第一步，就是先看看資料有沒有太多的空值，以及判斷空值不需要做什麼處理。比較常見的補空值的方式包括：直接補0、補平均值、補最大值、補最小值，又或是看前後欄位決定是參考上一列或是下一列的資料前後填充。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/raw-data.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="319" src="https://i0.wp.com/aderlab.com/wp-content/uploads/raw-data.png?resize=708%2C319&#038;ssl=1" alt="" class="wp-image-4390" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/raw-data.png?resize=1024%2C462&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/raw-data.png?resize=300%2C135&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/raw-data.png?resize=768%2C346&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/raw-data.png?resize=1536%2C693&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/raw-data.png?resize=2048%2C924&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/raw-data.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/raw-data.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>在處理空值之前，我們需要先檢查有哪些欄位有空值狀況，雖然說這份資料很輕易的可以看到有null值，但實務上還是不建議直接用肉眼去判斷，一來是耗時耗力，二來是當資料量太大的時候，通常不太能正確檢查出來。比較建議的作法是使用 POWER BI 內建的「資料行品質」功能來檢查。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/data-quality.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="353" src="https://i0.wp.com/aderlab.com/wp-content/uploads/data-quality.png?resize=708%2C353&#038;ssl=1" alt="" class="wp-image-4389" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/data-quality.png?resize=1024%2C511&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/data-quality.png?resize=300%2C150&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/data-quality.png?resize=768%2C383&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/data-quality.png?resize=1536%2C766&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/data-quality.png?resize=2048%2C1021&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/data-quality.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/data-quality.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>而以這份資料來說，透過資料行品質檢查後，我們可以發現「年月」的欄位資料空白的比例很高，細細去看資料會發現，是因為原始資料只有紀錄第一筆年月的資料，如果是跟第一筆的年月資料一樣的話，資料就會是空白的。</p>



<p>這種資料蠻常是因為原始資料使用了合併儲存格，合併儲存格雖然在檢視上會讓我們知道合併的欄位資料都是一樣的，但實際上只有第一筆是有資料的，其他都會是空白值，針對這類型的資料，我們能使用向下填空來補足空值。</p>



<figure class="wp-block-video"><video height="1800" style="aspect-ratio: 2880 / 1800;" width="2880" autoplay controls muted src="https://aderlab.com/wp-content/uploads/data-ffill.mov"></video><figcaption>資料品質檢查與項下填充操作步驟示範</figcaption></figure>



<h2 class="wp-block-heading">資料處理類型 3：資料分群</h2>



<p>第三個要分享的資料處理是資料歸類與分群，這份資料很大的重點在於有信用卡持卡人的出生年份，可以用來推估持卡人的年紀。不過年紀的範圍太廣，如果要用於資料分析，我就會先將出生年份轉換成年紀，接著再針對年紀做分群，把相同年齡帶的人歸類在一起，例如說：20-30歲、30-40歲等。</p>



<p>第一個步驟先進行持卡人的年紀計算。</p>



<p>可以使用POWER BI 裡面的「新增資料行」，點擊「自訂資料行」，然後就可以針對既有資料行進行計算，當然啦，如果是使用其他資料，也可以任意的新增自己想要呈現的資料行內容。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/add_col.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="503" src="https://i0.wp.com/aderlab.com/wp-content/uploads/add_col.png?resize=708%2C503&#038;ssl=1" alt="" class="wp-image-4368" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/add_col.png?resize=1024%2C727&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/add_col.png?resize=300%2C213&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/add_col.png?resize=768%2C545&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/add_col.png?resize=1536%2C1091&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/add_col.png?resize=2048%2C1454&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/add_col.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/add_col.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>取得年紀之後，接著就可以針對年紀來做分群，一樣使用POWER BI 裡面的「新增資料行」，這次使用的是「條件資料行」，條件資料行可以針對既有的資料行進行條件篩選，針對特定條件的資料指定特定值。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/groupbydata-choose.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="503" src="https://i0.wp.com/aderlab.com/wp-content/uploads/groupbydata-choose.png?resize=708%2C503&#038;ssl=1" alt="" class="wp-image-4369" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/groupbydata-choose.png?resize=1024%2C727&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/groupbydata-choose.png?resize=300%2C213&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/groupbydata-choose.png?resize=768%2C545&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/groupbydata-choose.png?resize=1536%2C1090&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/groupbydata-choose.png?resize=2048%2C1454&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/groupbydata-choose.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/groupbydata-choose.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>這麼說可能有點抽象，我用這份資料的年齡分群來舉例，以這份信用卡資料來說，我們剛剛透過簡單的新增資料行，已經取得信用卡持卡人的預估年紀，持卡人的年紀介於16-91歲。但是這個資料分佈對我來說太分散，資料分析上不太好使用，所以我想把年齡分成6個級距，分別是未滿20歲、20歲(含)到30歲、30歲(含)到40歲、40歲(含)到50歲、50歲(含)到60歲、60歲(含)以上。</p>



<p>那麼條件資料行就可以針對「持卡人年紀」設定條件判斷，如下圖所示，建立之後就會多一個欄位「持卡人年紀分群」，就可以拿到年紀分群之後的結果。</p>



<p>使用條件資料行的時候最需要注意的就是條件資料行由上到下的條件設定就代表著優先順序，當條件資料都是同一行時，判斷的優先順序不會影響到資料分群，但如果是用兩個以上的資料欄位來做條件資料行的判斷的話，就需要思考哪些條件是需要優先被考量的。</p>



<p>一樣用信用卡的資料來說明，像我們做年齡分群，使用的就只有同一行來當資料條件判斷，且就是「持卡人年紀」這一欄，一列資料只會有一個年紀，不會有一列資料既是25歲，又是90歲，所以這種情況下，資料判斷的優先順序就不會影響到每一列的資料要被歸類在哪一個年紀區間。</p>



<p>但假如，條件資料行我要使用地區以及年紀來判斷，這時候就會有資料重疊的問題，一列資料又有年紀，又有地區。所以當我想設定，25歲以下分類為族群A、台北市分類為族群B，有一列資料是台北市24歲的資料，這時候條件資料行的排序就很重要。</p>



<p>當你把25歲以下分類為族群A放在最上面，那這筆是台北市24歲的資料就會被歸類在族群A；相對的，如果你把台北市的分類放在25歲以下分類的位置上方，代表優先判斷台北市的分類，這筆是台北市24歲的資料就會被歸類在族群B，即便他符合了25歲以下，也不會再被歸類到族群B的分群裡。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/condition-col.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="417" src="https://i0.wp.com/aderlab.com/wp-content/uploads/condition-col.png?resize=708%2C417&#038;ssl=1" alt="" class="wp-image-4397" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/condition-col.png?resize=1024%2C603&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/condition-col.png?resize=300%2C177&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/condition-col.png?resize=768%2C452&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/condition-col.png?resize=1536%2C905&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/condition-col.png?w=1844&amp;ssl=1 1844w, https://i0.wp.com/aderlab.com/wp-content/uploads/condition-col.png?w=1416&amp;ssl=1 1416w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>最後，也提供新增資料行進行計算、新增條件資料行進行資料分組的資料處理步驟示範影片供參考～</p>



<figure class="wp-block-video"><video height="1660" style="aspect-ratio: 2868 / 1660;" width="2868" autoplay controls muted src="https://aderlab.com/wp-content/uploads/new-column-groupby.mov"></video></figure>



<h2 class="wp-block-heading">資料處理類型 4：合併查詢</h2>



<p>合併查詢跟我第一個分享的<a href="https://aderlab.com/data-analytics/power-bi-data-procedure-2/#資料處理類型_1：附加查詢">附加查詢</a>功能很類似，附加查詢是將兩份資料上下合併，而合併查詢則是將兩份資料左右合併。</p>



<p>而合併查詢跟下一個要介紹的資料連結也非常像，兩者都是將兩份資料左右連結在一起，差別是合併查詢是將兩份資料的所有欄位都合併成一份新的資料，而資料連結則是，在兩份資料不變更的情況下，連結資料欄位產生連結，讓我們可以在建立報表時拿兩份資料的資料維度跟資料指標組合成數據表格或是圖表。</p>



<p>合併查詢的第一步就是在常用的選單列右側，先找到「合併查詢」的按鈕，接著我們可以選擇要「合併查詢」或是「將查詢合併為新查詢」，兩者的差別在於，前者是在現在的資料下合併兩份資料，會更動到現在這份原始資料，而後者則是將想要合併的兩份資料獨立出來，新增一份新的資料表出來。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button-right-1.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="303" src="https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button-right-1.png?resize=708%2C303&#038;ssl=1" alt="" class="wp-image-4419" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button-right-1.png?resize=1024%2C438&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button-right-1.png?resize=300%2C128&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button-right-1.png?resize=768%2C329&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button-right-1.png?resize=1536%2C657&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button-right-1.png?resize=2048%2C876&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button-right-1.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/merge-button-right-1.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>進入合併查詢的設定畫面後，需要做三個步驟，第一個步驟是選擇想要把現有資料跟哪一份資料表合併，像這份信用卡資料，我要合併的就是信用卡消費資料跟縣市代碼參考表的資料。</p>



<p>第二個步驟是選擇兩份資料連結的依據，也就是所謂的KEY值，建議是兩份資料的這個欄位是一對一的關係或是一對多的關係，意思是說，比對的欄位至少有一邊的欄位資料內容是唯一值，這樣在合併過程，系統才會知道，怎麼將兩份資料比對並且合併起來，這個功能其實也等同於Excel的Vlookup功能，只是在POWER BI 裡，我們不需要寫公式，只需要選取想要連結的資料欄位就可以了。</p>



<p>最後一個步驟是選擇聯結種類，POWER BI 合併功能提供的聯結種類非常多，可以選擇第一份資料的所有資料跟第二份資料的所有欄位合併，只選擇特定欄位合併等。</p>



<p>信用卡資料我是想要把第一份資料完整留著，第二份資料有相符的縣市代碼，所以我就選擇「左方外部」的連結方式。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-2-1.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="443" src="https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-2-1.png?resize=708%2C443&#038;ssl=1" alt="" class="wp-image-4420" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-2-1.png?resize=1024%2C640&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-2-1.png?resize=300%2C188&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-2-1.png?resize=768%2C480&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-2-1.png?resize=1536%2C960&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-2-1.png?resize=2048%2C1280&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-2-1.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-2-1.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>做完這些步驟後，就能得到一份新的資料表，預設的名稱都會建立成合併1、合併2等以此類推，看你做了幾分合併查詢而定。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-3.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="443" src="https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-3.png?resize=708%2C443&#038;ssl=1" alt="" class="wp-image-4421" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-3.png?resize=1024%2C640&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-3.png?resize=300%2C188&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-3.png?resize=768%2C480&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-3.png?resize=1536%2C960&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-3.png?resize=2048%2C1280&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-3.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/right-merge-3.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>詳細的合併查詢操作步驟也可以參考下面這支操作示範影片～</p>



<figure class="wp-block-video"><video height="1750" style="aspect-ratio: 2868 / 1750;" width="2868" controls src="https://aderlab.com/wp-content/uploads/螢幕錄製-2022-10-30-下午3.37.19.mov"></video></figure>



<h2 class="wp-block-heading">資料處理類型5 ：資料連結</h2>



<p>最後一個，來分享資料連結！我之前有分享過這個功能，更詳細的功能用途跟完整說明可以延伸閱讀這篇：<a href="https://aderlab.com/data-analytics/power-bi-connect-data/" target="_blank" rel="noreferrer noopener">用 Power BI 取代 Vlookup 串接資料 輕鬆處理複雜資料分析</a>。</p>



<p>這邊的資料處理，我一樣拿信用卡資料為例。資料上蠻常出現這種以數字或英數混雜的代碼來做中文的代稱，以這份信用卡資料為例，這份資料就在「地區」的這個欄位，改以8位數的數字來替代縣市名稱。</p>



<p>這種資料呈現在實務上也非常常見，例如說電商的訂單資料就會有所謂的「Customer ID」，當我們想知道購買某項商品的客戶是誰？他們的年齡性別分布的時候，就會透過「Customer ID」去另外一張客戶資料表來找到答案。</p>



<p>回到信用卡資料的例子，想把地區代碼轉換成縣市的中文名稱，這時候就需要透過兩份資料表的共同欄位來建立資料連結，所以除了原本的信用卡資料之外，我還需要另外一份每一個地區代碼對應到哪一個縣市的縣市代碼比對表。</p>



<p>POWER BI 的資料串接功能在畫布區的地方，資料連結通常都會需要等所有的資料處理步驟都完成之後，關閉POWER BI 這個資料編輯器後，進到數據圖表的畫布區後才開始設定。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/close-query.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="405" src="https://i0.wp.com/aderlab.com/wp-content/uploads/close-query.png?resize=708%2C405&#038;ssl=1" alt="" class="wp-image-4411" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/close-query.png?resize=1024%2C586&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/close-query.png?resize=300%2C172&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/close-query.png?resize=768%2C440&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/close-query.png?resize=1536%2C880&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/close-query.png?resize=2048%2C1173&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/close-query.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/close-query.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>進到畫布區後，找到左側第三個圖示按鈕「」，進入資料連結設定的區塊。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/connection-model.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="407" src="https://i0.wp.com/aderlab.com/wp-content/uploads/connection-model.png?resize=708%2C407&#038;ssl=1" alt="" class="wp-image-4412" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/connection-model.png?resize=1024%2C589&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/connection-model.png?resize=300%2C173&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/connection-model.png?resize=768%2C442&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/connection-model.png?resize=1536%2C884&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/connection-model.png?resize=2048%2C1178&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/connection-model.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/connection-model.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>這個區塊可以簡單透過拉取完成連結，例如說我們就拉取信用卡資料的「地區欄位」，接著拉到縣市代碼比對表的「縣市代碼欄位」。</p>



<p>完成之後可以看到畫面在兩個資料間出現了線條箭頭，一邊呈現「1」，另外一邊則是呈現「*」，代表著兩份資料已經連結起來，資料之間呈現一對多的關係。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/data-connect.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="404" src="https://i0.wp.com/aderlab.com/wp-content/uploads/data-connect.png?resize=708%2C404&#038;ssl=1" alt="" class="wp-image-4413" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/data-connect.png?resize=1024%2C585&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/data-connect.png?resize=300%2C171&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/data-connect.png?resize=768%2C439&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/data-connect.png?resize=1536%2C878&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/data-connect.png?resize=2048%2C1170&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/data-connect.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/data-connect.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>什麼是一對多的資料關係？我們回到兩份資料的資料內容來說明。</p>



<p>仔細看兩份資料的比對欄位，信用卡資料的「地區」的數字代碼是重複的，縣市代碼比對表對應的「縣市代碼」則不重複的，系統才會知道看到「63000000」對應到的縣市是臺北市。一對多的資料關係，簡單來說就是用一份沒有重複值的資料欄位，對應到另外一份有重複值的資料欄位，讓我們可以透過代碼欄位串接，把兩份資料連結在一起使用。</p>



<figure class="wp-block-image size-large is-resized"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/connection-related.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/aderlab.com/wp-content/uploads/connection-related.png?resize=708%2C410&#038;ssl=1" alt="" class="wp-image-4401" width="708" height="410" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/connection-related.png?resize=1024%2C593&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/connection-related.png?resize=300%2C174&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/connection-related.png?resize=768%2C445&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/connection-related.png?resize=1536%2C890&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/connection-related.png?resize=2048%2C1187&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/connection-related.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/connection-related.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<figure class="wp-block-video"><video height="1750" style="aspect-ratio: 2868 / 1750;" width="2868" controls src="https://aderlab.com/wp-content/uploads/right-merge2.mov"></video></figure>



<p>好啦～這次5個 POWER BI 的資料處理功能也介紹完畢了，希望對看完這篇文章，正在苦惱資料處理流程的你有幫助，下篇文章見～</p>



<p>原始資料來源：<a href="https://community.tableau.com/s/question/0D54T00000CWeX8SAL/sample-superstore-sales-excelxls" target="_blank" rel="noreferrer noopener nofollow">https://data.gov.tw/dataset/38319</a><br>資料下載連結：<a href="https://pse.is/4jyj8t" target="_blank" rel="noreferrer noopener">https://pse.is/4jyj8t</a>，雲端連結中共包括兩份檔案：<br>1. Power BI 示範檔案：各年齡層信用卡持卡人於六都消費樣態<br>2. Excel 營收資料檔案：資料處理(下篇)_空格條件行查詢與資料串接</p>



<p class="has-text-align-right">Sharon</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide"/>



<p class="has-medium-font-size"><strong>Buy me a coffee&nbsp; 用行動支持我的內容創作</strong></p>



<p><em>如果我的文章對你有幫助，歡迎用行動支持我的內容創作，小額贊助請我喝咖啡、留言或是寄信來跟我分享你的收穫，都會讓我持續有動力分享更多內容唷～</em></p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button aligncenter is-style-fill"><a class="wp-block-button__link has-black-color has-luminous-vivid-amber-background-color has-text-color has-background" href="https://www.buymeacoffee.com/aderlabsharon" target="_blank" rel="noreferrer noopener">以小額贊助支持Sharon</a></div>
</div>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-data-procedure-2/">5 個常見的 POWER BI 資料處理功能介紹（下篇）￼</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></content:encoded>
					
		
		<enclosure url="https://aderlab.com/wp-content/uploads/add-together.mov" length="20367046" type="video/quicktime" />
<enclosure url="https://aderlab.com/wp-content/uploads/data-ffill.mov" length="10688804" type="video/quicktime" />
<enclosure url="https://aderlab.com/wp-content/uploads/new-column-groupby.mov" length="82814386" type="video/quicktime" />
<enclosure url="https://aderlab.com/wp-content/uploads/螢幕錄製-2022-10-30-下午3.37.19.mov" length="31376855" type="video/quicktime" />
<enclosure url="https://aderlab.com/wp-content/uploads/right-merge2.mov" length="41456074" type="video/quicktime" />

		<post-id xmlns="com-wordpress:feed-additions:1">4365</post-id>	</item>
		<item>
		<title>5 個常見的 POWER BI 資料處理功能介紹（上篇）</title>
		<link>https://aderlab.com/data-analytics/power-bi-data-procedure-1/</link>
		
		<dc:creator><![CDATA[Sharon]]></dc:creator>
		<pubDate>Sun, 30 Oct 2022 05:55:55 +0000</pubDate>
				<category><![CDATA[Microsoft Power BI]]></category>
		<category><![CDATA[數據分析]]></category>
		<guid isPermaLink="false">https://aderlab.com/?p=4324</guid>

					<description><![CDATA[<p>上篇文章分享怎麼利用 Microsoft Power BI 進行資料更新，讓我們可以透過移動檔案到指定資料夾以及重新整理，達到半自動資料更新的效果。 不過啊，P&#8230;</p>
<p><a href="https://aderlab.com/data-analytics/power-bi-data-procedure-1/" class="btn-continue">繼續閱讀<span class="arrow-continue">&#8594;</span></a></p>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-data-procedure-1/">5 個常見的 POWER BI 資料處理功能介紹（上篇）</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>上篇文章分享怎麼利用 Microsoft Power BI 進行資料更新，讓我們可以透過移動檔案到指定資料夾以及重新整理，達到半自動資料更新的效果。</p>



<p>不過啊，Power BI之所以可以大量節省時間，不僅僅是因為可以自動更新資料，更重要的是，當我們把所有資料處理的流程建立在 POWER BI 時，同樣的資料處理步驟就可以不必再重做一次，也就能省去大把的資料處理時間。</p>



<p>這一篇延續聊聊常見幾種 Power BI 資料處理方式，也建議大家在整理資料欄位、格式的時候，不要急著在匯入 POWER BI 前就整理，把整理的過程留在匯入資料以後，POWER BI 才能幫我們紀錄資料處理的每一個步驟，讓我們能在每一次匯入一樣的資料欄位一鍵套用，更聚焦在數據觀察與分析上！</p>



<p>這篇文章的資料範例是信用卡交易的資料，詳細的資料來源與檔案放於文章的最後，這次要分享的是如何把經過樞紐處理過的寬資料轉換成長資料，同時介紹 5 個在資料處理過程中常常需要使用到的功能，包括：資料標題處理、解樞紐分析表、資料切割與合併、資料格式調整與欄位刪減。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/change-before-after-2.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="245" src="https://i0.wp.com/aderlab.com/wp-content/uploads/change-before-after-2.png?resize=708%2C245&#038;ssl=1" alt="" class="wp-image-4381" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/change-before-after-2.png?resize=1024%2C355&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-before-after-2.png?resize=300%2C104&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-before-after-2.png?resize=768%2C266&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-before-after-2.png?resize=1536%2C532&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-before-after-2.png?resize=2048%2C710&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-before-after-2.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-before-after-2.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<h2 class="wp-block-heading">資料處理類型1：將資料列抬升為標題</h2>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="230" src="https://i0.wp.com/aderlab.com/wp-content/uploads/change-title.png?resize=708%2C230&#038;ssl=1" alt="" class="wp-image-4330" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/change-title.png?resize=1024%2C332&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-title.png?resize=300%2C97&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-title.png?resize=768%2C249&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-title.png?resize=1536%2C498&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-title.png?resize=2048%2C665&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-title.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-title.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></figure>



<p>一開始匯入資料的時候，會發現資料欄位名稱是：Data.Column1、Data.Column2、Data.Column3、&#8230;&#8230;、Data.Column1，但是我們需要「產業別」、201401、201402等資料列當作資料標題。</p>



<p>調整的步驟很簡單，只要點選「使用第一個資料列作為標題」就可以了。以這份資料的例子來說，因為我們想要當作標題的列是第二列，所以需要點選兩次「使用第一個資料列作為標題」的按鈕。</p>



<p>當我們在POWER BI 裡面的POWER QUERY進行資料處理時，所有的調整步驟都會被記錄在右側的「套用的步驟」，一來是可以讓我們隨時回顧針對原始資料做過哪些資料處理步驟，另外一方面，當我們不小心操作錯誤時，也可以在「套用的步驟」區塊點選要選取的步驟，按下步驟列最前方的X就可以了。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/rasise-title-1.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="241" src="https://i0.wp.com/aderlab.com/wp-content/uploads/rasise-title-1.png?resize=708%2C241&#038;ssl=1" alt="" class="wp-image-4351" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/rasise-title-1.png?resize=1024%2C348&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/rasise-title-1.png?resize=300%2C102&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/rasise-title-1.png?resize=768%2C261&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/rasise-title-1.png?resize=1536%2C522&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/rasise-title-1.png?resize=2048%2C695&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/rasise-title-1.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/rasise-title-1.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<h2 class="wp-block-heading">資料處理類型2：長寬資料轉換</h2>



<p>確認好原始的資料標題跟樞紐表格之後，接著要進行的就是解樞紐分析表的操作，又常常被稱為將寬數據整理成長數據。轉換寬數據的第一個步驟是先選取要解開樞紐分析的範圍，以這份資料來說就是所有年月的信用卡交易筆數數據。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/choose-block.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="238" src="https://i0.wp.com/aderlab.com/wp-content/uploads/choose-block.png?resize=708%2C238&#038;ssl=1" alt="" class="wp-image-4331" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/choose-block.png?resize=1024%2C344&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/choose-block.png?resize=300%2C101&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/choose-block.png?resize=768%2C258&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/choose-block.png?resize=1536%2C516&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/choose-block.png?resize=2048%2C687&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/choose-block.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/choose-block.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>接著將畫面切換到「轉換」工具區，點選「取消資料行樞紐」。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="237" src="https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot.png?resize=708%2C237&#038;ssl=1" alt="" class="wp-image-4327" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot.png?resize=1024%2C343&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot.png?resize=300%2C100&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot.png?resize=768%2C257&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot.png?resize=1536%2C514&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot.png?resize=2048%2C685&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>就完成了將寬數據轉換成長數據的結果了。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot-result.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="411" src="https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot-result.png?resize=708%2C411&#038;ssl=1" alt="" class="wp-image-4326" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot-result.png?resize=1024%2C594&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot-result.png?resize=300%2C174&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot-result.png?resize=768%2C445&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot-result.png?resize=1536%2C890&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot-result.png?resize=2048%2C1187&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot-result.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/cancel-pivot-result.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<h2 class="wp-block-heading">資料處理類型3：資料分割與合併</h2>



<p>資料解樞紐之後，會發現年月的那一欄是日期格式，但是直接轉換成日期格式又會出現錯誤，原因是因為我們直接看可以判斷這個欄位的資料是想表達年份＋月份，但是對於系統來說卻沒辦法，對於系統來說只是一個6位數的數字，沒有符合系統預設的日期表達方式，所以沒辦法直接轉換成日期格式。</p>


<div class="wp-block-image is-style-columns">
<figure class="aligncenter"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="325" src="https://i0.wp.com/aderlab.com/wp-content/uploads/change-date-error-1.png?resize=708%2C325&#038;ssl=1" alt="" class="wp-image-4343" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/change-date-error-1.png?resize=1024%2C470&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-date-error-1.png?resize=300%2C138&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-date-error-1.png?resize=768%2C353&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/change-date-error-1.png?w=1402&amp;ssl=1 1402w" sizes="auto, (max-width: 708px) 100vw, 708px" /></figure>
</div>


<p>接下來我們就需要幫助這個欄位更改成日期格式，以下示範以資料分割以及新增欄位方式調整成日期格式的做法。</p>



<p>將工作列切換到「轉換」的工作區，點選「分割資料行」，分割資料行的方式有非常多種，以這份資料的資料數共6位數字，可以依「字元數」或是「依位置」分割。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-data.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="372" src="https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-data.png?resize=708%2C372&#038;ssl=1" alt="" class="wp-image-4339" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-data.png?resize=1024%2C538&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-data.png?resize=300%2C158&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-data.png?resize=768%2C403&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-data.png?w=1390&amp;ssl=1 1390w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>如果是依字元數分割資料行的話，輸入想要分割的字元數即可，像是這份資料我們想把年份跟月份切分開來，所以字元數就輸入「4」。</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%"><div class="wp-block-image is-style-columns">
<figure class="aligncenter is-resized"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/position-split.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/aderlab.com/wp-content/uploads/position-split.png?resize=708%2C348&#038;ssl=1" alt="" class="wp-image-4337" width="708" height="348" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/position-split.png?resize=1024%2C504&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/position-split.png?resize=300%2C148&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/position-split.png?resize=768%2C378&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/position-split.png?w=1406&amp;ssl=1 1406w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>
</div></div>
</div>
</div>
</div>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-before-after.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="151" src="https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-before-after.png?resize=708%2C151&#038;ssl=1" alt="" class="wp-image-4382" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-before-after.png?resize=1024%2C219&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-before-after.png?resize=300%2C64&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-before-after.png?resize=768%2C164&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-before-after.png?resize=1536%2C328&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-before-after.png?resize=2048%2C437&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-before-after.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/spilt-before-after.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>切割完資料欄位之後，就可以透過新增資料欄位來合併年份、月份、並新增日期以符合日期格式。</p>



<p>日期的資料我們先預設為每月1日，輸入公式：[年月.1]&amp;&#8221;/&#8221;&amp;[年月.2]&amp;&#8221;/1&#8243;。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/build-new-date-1.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="442" src="https://i0.wp.com/aderlab.com/wp-content/uploads/build-new-date-1.png?resize=708%2C442&#038;ssl=1" alt="" class="wp-image-4354" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/build-new-date-1.png?resize=1024%2C639&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/build-new-date-1.png?resize=300%2C187&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/build-new-date-1.png?resize=768%2C479&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/build-new-date-1.png?w=1394&amp;ssl=1 1394w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<h2 class="wp-block-heading">資料處理類型4：資料格式更改</h2>



<p>建立完新的年月日資料欄之後，我們就可以將這個欄位更改成日期格式了。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/to-date-format.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="414" src="https://i0.wp.com/aderlab.com/wp-content/uploads/to-date-format.png?resize=708%2C414&#038;ssl=1" alt="" class="wp-image-4341" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/to-date-format.png?resize=1024%2C599&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/to-date-format.png?resize=300%2C176&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/to-date-format.png?resize=768%2C449&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/to-date-format.png?resize=1536%2C899&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/to-date-format.png?w=1678&amp;ssl=1 1678w, https://i0.wp.com/aderlab.com/wp-content/uploads/to-date-format.png?w=1416&amp;ssl=1 1416w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<h2 class="wp-block-heading">資料處理類型5：資料欄位刪除</h2>



<p>最後，針對用不到的「年月.1」、「年月.2」進行資料行刪除。</p>



<figure class="wp-block-image size-large is-resized"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/delete_col.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/aderlab.com/wp-content/uploads/delete_col.png?resize=708%2C580&#038;ssl=1" alt="" class="wp-image-4334" width="708" height="580" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/delete_col.png?resize=1024%2C839&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/delete_col.png?resize=300%2C246&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/delete_col.png?resize=768%2C629&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/delete_col.png?resize=1536%2C1259&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/delete_col.png?w=1706&amp;ssl=1 1706w, https://i0.wp.com/aderlab.com/wp-content/uploads/delete_col.png?w=1416&amp;ssl=1 1416w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a><figcaption class="wp-element-caption">就完成了完整的資料處理，得到了一份可以進行視覺化報表處理的數據資料了。</figcaption></figure>



<figure class="wp-block-image size-full is-resized"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/data-clean-result.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" src="https://i0.wp.com/aderlab.com/wp-content/uploads/data-clean-result.png?resize=487%2C452&#038;ssl=1" alt="" class="wp-image-4332" width="487" height="452" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/data-clean-result.png?w=974&amp;ssl=1 974w, https://i0.wp.com/aderlab.com/wp-content/uploads/data-clean-result.png?resize=300%2C278&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/data-clean-result.png?resize=768%2C713&amp;ssl=1 768w" sizes="auto, (max-width: 487px) 100vw, 487px" /></a></figure>



<p>POWER BI 常見的5種資料處理方式就分享到這裡，下一篇會再分享另外 5 種常用的資料處理功能，下一篇文章見～</p>



<p>原始資料來源：<a href="https://community.tableau.com/s/question/0D54T00000CWeX8SAL/sample-superstore-sales-excelxls" target="_blank" rel="noreferrer noopener nofollow">https://data.gov.tw/dataset/38319</a><br>資料下載連結：<a href="https://pse.is/4jy9gr" target="_blank" rel="noreferrer noopener">https://pse.is/4jy9gr</a>，雲端連結中共包括兩份檔案：<br>1. Power BI 示範檔案：信用卡資料解樞紐_資料預處理(上篇)<br>2. Excel 營收資料檔案：各年齡層信用卡持卡人於六都消費樣態</p>



<p class="has-text-align-right">Sharon</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide"/>



<p class="has-medium-font-size"><strong>Buy me a coffee&nbsp; 用行動支持我的內容創作</strong></p>



<p><em>如果我的文章對你有幫助，歡迎用行動支持我的內容創作，小額贊助請我喝咖啡、留言或是寄信來跟我分享你的收穫，都會讓我持續有動力分享更多內容唷～</em></p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button aligncenter is-style-fill"><a class="wp-block-button__link has-black-color has-luminous-vivid-amber-background-color has-text-color has-background wp-element-button" href="https://www.buymeacoffee.com/aderlabsharon" target="_blank" rel="noreferrer noopener">以小額贊助支持Sharon</a></div>
</div>



<p class="has-text-align-right"></p>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-data-procedure-1/">5 個常見的 POWER BI 資料處理功能介紹（上篇）</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4324</post-id>	</item>
		<item>
		<title>用 POWER BI 自動更新數據，解決重複性資料整理</title>
		<link>https://aderlab.com/data-analytics/power-bi-auto-updating/</link>
		
		<dc:creator><![CDATA[Sharon]]></dc:creator>
		<pubDate>Sun, 23 Oct 2022 07:46:38 +0000</pubDate>
				<category><![CDATA[Microsoft Power BI]]></category>
		<category><![CDATA[數據分析]]></category>
		<guid isPermaLink="false">https://aderlab.com/?p=4274</guid>

					<description><![CDATA[<p>你有每週要固定產出的報表或是資料處理嗎？與其每一次都重頭開始整理原始資料，不妨試試 POWER BI 來進行資料處理與更新，讓我們不必花大把的時間在做重複性的資&#8230;</p>
<p><a href="https://aderlab.com/data-analytics/power-bi-auto-updating/" class="btn-continue">繼續閱讀<span class="arrow-continue">&#8594;</span></a></p>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-auto-updating/">用 POWER BI 自動更新數據，解決重複性資料整理</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>你有每週要固定產出的報表或是資料處理嗎？與其每一次都重頭開始整理原始資料，不妨試試 POWER BI  來進行資料處理與更新，讓我們不必花大把的時間在做重複性的資料整理，只要更換資料來源就能快速完成！</p>



<p>如果對 POWER BI 這項工具是什麼還不熟悉，可以先看看這篇： <strong><a href="https://aderlab.com/data-analytics/power-bi-intro/">Microsoft Power BI是什麼？談Power BI 的應用場景與功能簡介</a></strong>。</p>



<h2 class="wp-block-heading">前言</h2>



<p>我學習 POWER BI 的原因是因為我上一份工作有頻繁且即時需要進行的交叉分析，例如產品銷售要分成不同的產品分類來看，組合商品業績要拆分單品業績來看每個產品的銷售狀況、客戶消費要區分成會員等級、會員消費頻率、會員是新舊客狀態等不同維度來看。</p>



<p>這些需求聽起來容易，但是資料彙整的過程卻特別不容易，光是數據處理與比對就需要花費我大部分的工作時間，常常讓我在資料處理完後就沒有時間深入挖掘數據背後的意義。這是我學習 POWER BI 的起因，起初是希望減少重複性工作內容，後來愈學愈覺得 POWER BI 有更多層面的應用，也希望透過文章的分享，讓現在還深陷於資料處理苦海的你，有一個提升工作效率的方向，那就開始囉！</p>



<p>這篇文章我以銷售數據為例，分享如何用 POWER BI 的 Power Query 進行資料處理與自動更新。</p>



<p>假設我有一份從ERP可以固定下載的訂單資料，每週都需要固定做資料整理，分析每月的區域營業額、每個區域的販售品項，產出固定的數據表格與報告圖表，告訴生產部門哪些區域需要需要生產哪些商品。我一開始的做法就是每月都從ERP下載一次原始資料，然後針對原始資料進行資料處理，接著將處理好的資料在EXCEL裡面進行樞紐分析、圖表製作，每月持續做一樣的步驟。</p>



<p>上述的步驟當然沒問題，但如果能更有效的使用BI工具，將能節省掉 80%以上的資料處理時間，花更多的時間了解數據背後的成因以及提出後續的行動方案。</p>



<h2 class="wp-block-heading">什麼情況適合用 POWER BI 進行資料更新？</h2>



<p>如果你平常在整理的資料有下特點，那就非常適合使用 POWER BI 來進行資料處理與更新：</p>



<ol class="wp-block-list"><li>資料格式一致 <br>資料格式一致代表資料的存檔種類是一樣的，例如說下載下來的檔案都是CSV檔、JSON檔，又或是固定放在資料庫裡，都可以將資料串接進 POWER BI 裡。<br>POWER BI 可以串接的資料格式可以參考官方文件：<a href="https://learn.microsoft.com/zh-tw/power-bi/connect-data/desktop-data-sources" rel="nofollow">Power BI Desktop 中的資料來源</a><br><br></li><li>資料欄位名稱與欄位數一致 <br>資料欄位其實就是資料的維度，以訂單資料來說，如果你第一份處理的資料共有6個欄位，欄位名稱分別是：訂單成立日期、訂單ID、客戶ID、產品名稱、消費金額、數量，那麼下一份資料也必須是6個欄位，而且欄位名稱需要和上一次的資料欄位名稱一樣。<br><br></li><li>資料檔案的檔案夾位置一致 <br>同樣需要更新的資料需要存在同一個電腦的同個檔案夾裡，且檔案夾原始存放位置假設是 「D:/Desktop/訂單資料」，那麼新的資料也需要存放在 「D:/Desktop/訂單資料」裡。</li></ol>



<p>以上的條件不難達成，一般來說如果是固定從ERP或資料後台下載資料，資料的欄位跟格式大部分都是固定的，比較需要注意的是，如果你下載資料的欄位是可以自己篩選，那就需要留意資料欄位的數量跟欄位的順序是否和首次資料一致。</p>



<h2 class="wp-block-heading">如何用 POWER BI 進行半自動更新資料</h2>



<p>以下將示範如果固定匯出EXCEL或CSV檔的話，如何進行POWER BI 的資料匯入與後續資料更新。</p>


<div class="saswp-how-to-block-section"><div class="saswp-how-to-block-steps"><p>建立半自動更新資料的 POWER BI 報表</p><ol><li><h1 class="saswp-how-to-step-name ">下載原始資料檔案，放置在一個資料夾內</h1><p class="saswp-how-to-step-text">資料夾放置位置需要固定，在建立資料夾時就需要想清楚要放在哪個電腦路徑。</p></li><li><h1 class="saswp-how-to-step-name ">開啟 POWER BI 與匯入資料</h1><p class="saswp-how-to-step-text">開啟應用程式之後，點擊「取得資料」，用此選取檔案位置。因為後續希望可以做到自動更新資料，所以資料匯入方式選取「資料夾」，這樣以後將新的資料放在同一個資料夾時，就能讀取到新的資料內容了。<br><img data-recalc-dims="1" decoding="async" style="width: 17222870px" src="https://i0.wp.com/aderlab.com/wp-content/uploads/open.png?w=708&#038;ssl=1" alt=""><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/aderlab.com/wp-content/uploads/file-data.png?w=708&#038;ssl=1" alt=""><br></p></li><li><h1 class="saswp-how-to-step-name ">資料預覽與載入</h1><p class="saswp-how-to-step-text">載入資料前建議都先進行資料的格式、合併處理，所以先點擊「轉換資料」，就可以進到POWER QUERY 的系統進行資料整理。<img data-recalc-dims="1" decoding="async" style="width: 13081754px" src="https://i0.wp.com/aderlab.com/wp-content/uploads/file-loading.png?w=708&#038;ssl=1" alt=""></p></li><li><h1 class="saswp-how-to-step-name ">資料合併與分析前處理</h1><p class="saswp-how-to-step-text">第一次讀取資料夾時，因為我只有放一份Excel檔案，所以可以看到畫面就只有一列的資料列，假設我放了3份檔案，那畫面就會出現3份資料列。這個步驟是需要將放在資料夾裡面的檔案資料展開、合併起來，並進行資料欄位調整。<br><br>首先在Content的區塊按下右鍵，選擇「移除其他資料行」，接著就可以將Content標題右側的向下箭頭點下去之後展開資料，展開的過程也同步會進行資料合併。這也就是為什麼前面提到資料的欄位名稱、欄位數必須跟首份資料一致的原因，因為如果不一致的話，在合併的過程中系統就會因為欄位名稱無法核對到而出錯。<br><img data-recalc-dims="1" decoding="async" style="width: 16982878px" src="https://i0.wp.com/aderlab.com/wp-content/uploads/data-clean-1.png?w=708&#038;ssl=1" alt=""><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/aderlab.com/wp-content/uploads/data-clean-2.png?w=708&#038;ssl=1" alt=""><br><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/aderlab.com/wp-content/uploads/data-clean-3.png?w=708&#038;ssl=1" alt=""></p></li><li><h1 class="saswp-how-to-step-name ">建立需要的報表格式</h1><p class="saswp-how-to-step-text">我先簡單建立一個月份的區域銷售數量表格、業績佔比圓餅圖以及產品銷售數量的表格，這個就是第一個月的資料處理流程與建表。<img data-recalc-dims="1" decoding="async" style="width: 15442852px" src="https://i0.wp.com/aderlab.com/wp-content/uploads/demo-dashboard.png?w=708&#038;ssl=1" alt=""></p></li><li><h1 class="saswp-how-to-step-name ">下次下載與更新資料</h1><p class="saswp-how-to-step-text">等到了下一次需要再度分析同樣的銷售狀況的時候，這時候只要下載新的一個時間段的資料，然後把新的資料移動到上次建立的資料夾即可。以這篇文章的範例則是我在原本的資料夾（圖1）加入了2015年12月的最新資料(圖2)。<br><br><img data-recalc-dims="1" decoding="async" style="width: 4761238px" src="https://i0.wp.com/aderlab.com/wp-content/uploads/file_final.png?w=708&#038;ssl=1" alt=""><br><br><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/aderlab.com/wp-content/uploads/file_start.png?w=708&#038;ssl=1" alt=""></p></li><li><h1 class="saswp-how-to-step-name ">開啟 POWER BI 重新整理資料</h1><p class="saswp-how-to-step-text">在移動完最新一筆的資料檔案後，開啟 POWER BI ，在POWER BI 按下「重新整理」，接著2015年12月的資料就會進到報表，並且裡面了。<br><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/aderlab.com/wp-content/uploads/update-data.png?w=708&#038;ssl=1" alt=""><br><br><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/aderlab.com/wp-content/uploads/result-dec.png?w=708&#038;ssl=1" alt=""></p></li></ol></div><div class="saswp-how-to-block-tools"></div><div class="saswp-how-to-block-material"></div></div>


<p></p>



<p>用POWER BI 的這個工具，還是免不了第一次的資料處理和表格、圖表設計步驟，但他的最大優點在於，同一份資料處理和分析報表只需要做一次，下一次就能直接透過更新資料來源與重新整理，快速產出例行性的分析報告，是不是快速很多了呢？下次再處理同樣一份的例行報告的時候，不妨試試看POWER BI 這個工具吧！</p>



<p>最後也提供我整理過的原始資料檔案以及 Power BI 實作檔案給看過文章的你自由使用，歡迎動手實作看看，下篇文章見啦～</p>



<p>原始資料來源：<a href="https://community.tableau.com/s/question/0D54T00000CWeX8SAL/sample-superstore-sales-excelxls" target="_blank" rel="noreferrer noopener nofollow">https://community.tableau.com/s/question/0D54T00000CWeX8SAL/sample-superstore-sales-excelxls</a><br>資料下載連結：<a href="https://pse.is/4jrfdb" target="_blank" rel="noreferrer noopener">https://pse.is/4jrfdb</a>，雲端連結中共包括兩份檔案：<br>1. Power BI 示範檔案：data_automation.pbix<br>2. Excel 營收資料檔案：每月銷售數據</p>



<p class="has-text-align-right">Sharon</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide"/>



<p class="has-medium-font-size"><strong>Buy me a coffee&nbsp; 用行動支持我的內容創作</strong></p>



<p><em>如果我的文章對你有幫助，歡迎用行動支持我的內容創作，小額贊助請我喝咖啡、留言或是寄信來跟我分享你的收穫，都會讓我持續有動力分享更多內容唷～</em></p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button aligncenter is-style-fill"><a class="wp-block-button__link has-black-color has-luminous-vivid-amber-background-color has-text-color has-background" href="https://www.buymeacoffee.com/aderlabsharon" target="_blank" rel="noreferrer noopener">以小額贊助支持Sharon</a></div>
</div>



<p></p>



<p class="has-text-align-right">Sharon</p>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-auto-updating/">用 POWER BI 自動更新數據，解決重複性資料整理</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4274</post-id>	</item>
		<item>
		<title>用 Power BI 取代 Vlookup 串接資料 輕鬆處理複雜資料分析</title>
		<link>https://aderlab.com/data-analytics/power-bi-connect-data/</link>
		
		<dc:creator><![CDATA[Sharon]]></dc:creator>
		<pubDate>Sun, 28 Aug 2022 07:41:49 +0000</pubDate>
				<category><![CDATA[Microsoft Power BI]]></category>
		<category><![CDATA[數據分析]]></category>
		<guid isPermaLink="false">https://aderlab.com/?p=4237</guid>

					<description><![CDATA[<p>使用 Excel Vlookup 或樞紐分析是你的工作日常嗎？如果你苦於資料耗費了大半的時間，這篇文章將介紹 Power BI 來幫助你提升效率，深入挖掘數據，包括這個工具哪裡優於 Vlookup，如何3秒內完成資料連結，讓你能減少80%以上資料預處理的時間！</p>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-connect-data/">用 Power BI 取代 Vlookup 串接資料 輕鬆處理複雜資料分析</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>今天想要分享的是 Miscrosoft Power BI (簡稱：Power BI )的功能：資料串接，如果你常常使用 EXCEL VLOOKUP公式或是大量的使用樞紐分析做不同的數據觀測，那 Power BI 絕對可以讓你事半功倍！那就開始囉！</p>



<h2 class="wp-block-heading">用 Power BI 連結資料有什麼好處？</h2>



<p>在說明如何用 POWER BI 連結資料來取代 Excel Vlookup 公式前，先來談談用 POWER BI 連結資料有什麼好處，我歸納了總共有以下四個優於 Excel Vlookup 的特點</p>



<ol class="wp-block-list"><li>系統會自動連結不同資料表相同名稱的欄位 <br>當資料匯入 Power BI 後，如果你的資料的欄位名稱一樣，讓系統可以判讀兩個欄位是有相關的欄位，就會自動幫你把欄位做連結，而我們需要做的就是檢查即可。</li><li>一鍵拉取比對欄位，不需要寫公式 <br>如果你匯入的資料欄位名稱不一樣，或是說系統沒有自動連結起來也沒關係，在 Power BI 內資料連接是以拖拉的方式連結，使用起來非常直覺且快速。</li><li>可以處理一對多的資料比對 <br>使用 Excel Vlookup 公式的你應該不陌生， Vlookup 雖然方便，但是當我們需要回傳不只一筆比對資料的時候，每個公式都需要重寫一次，不過在 Power BI 上卻相當彈性，只需要第一次將相關欄位串接，就可以把兩張表的資料互相使用，而且不僅可以處理一對一的資料、一對多的資料也沒問題。</li><li>新增資料之後，數據也會跟著變動 <br>這個我認為是 Power BI 相當強大好用的功能，意思是當我們匯入的資料如果做資料新增或修改，只要原始檔案的檔名、存放位置不做更動，那麼只要在 Power BI 內按下重新整理，資料就會自動更新到 Power BI ，當然，資料串接也不需要重新做一次。</li></ol>



<p>至於什麼時候我會建議直接使用 Excel Vlookup 就好呢？以下幾種情況我就會不建議把資料拉到 Power BI 來進行，例如說你處理的只是一次性使用的資料，資料量比較少又或是比對欄位需求少的資料，這些分析需求相對簡單的時後，用 Excel 其實就綽綽有餘。而當你遇到資料量比較大，資料分析需求比較複雜的時候，我就建議可以改用 Power BI 減少繁瑣或例行的資料清理流程。</p>



<h2 class="wp-block-heading">如何用 Power BI 取代 Excel Vlookup？</h2>



<p>以下示範以電商常見的訂單資料與客戶資料比對做範例。通常訂單資料會有客戶的ID、購買商品、購買金額、消費國家地區等，初步的訂單資料就可以讓我們分析很多題目，例如說：哪些商品賣的比較好？消費者習慣的配送方式是以哪個居多，這個配送方式還有沒有加速配送抵達的機會？又或是哪些國家或城市的訂單最多？以這些地區投入的廣告成本來說，有沒有投入多，但是賺回的營收少又或是投入少，但是報酬超高的地區需要做資源的配置等。</p>



<p>雖然訂單資料已經可以讓我們看到很多分析角度，但實務上企業也很常以客戶輪廓的角度來分析營收狀況，例如說，會買商品的客人性別佔比、年齡分佈，有沒有某個族群是高貢獻族群，不同客群喜歡的商品偏好等。</p>



<div class="schema-how-to wp-block-yoast-how-to-block"><p class="schema-how-to-description">接下來我就用電商常見的訂單資料與客戶資料來做範例，示範如何利用 Power BI 來串接兩份資料，做出更深入的資料串接、歸納與拆解，當然你也可以依照下列資料串接的原則串接兩份以上的資料，讓數據分析更深入有效。</p> <ol class="schema-how-to-steps"><li class="schema-how-to-step" id="how-to-step-1661610575678"><strong class="schema-how-to-step-name">開啟 Power BI<br/></strong> <p class="schema-how-to-step-text">目前 Power BI 有提供免費的版本，只要到<a href="https://powerbi.microsoft.com/zh-tw/desktop/" target="_blank" rel="noreferrer noopener nofollow"> Power BI 官方的網頁</a>下載就可以使用囉，唯一的限制是，目前 Power BI 僅提供 Windows 作業系統使用，是目前比較可惜的部分。下載之後打開就會呈現如下圖的畫面。<img loading="lazy" decoding="async" width="2872" height="1664" src="https://i0.wp.com/aderlab.com/wp-content/uploads/01-first-page.png?fit=2872%2C1664&amp;ssl=1" class="attachment-full size-full" alt="" style="max-width: 100%; height: auto;" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/01-first-page.png?w=2872&amp;ssl=1 2872w, https://i0.wp.com/aderlab.com/wp-content/uploads/01-first-page.png?resize=300%2C174&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/01-first-page.png?resize=1024%2C593&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/01-first-page.png?resize=768%2C445&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/01-first-page.png?resize=1536%2C890&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/01-first-page.png?resize=2048%2C1187&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/01-first-page.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/01-first-page.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></p> </li><li class="schema-how-to-step" id="how-to-step-1661610587707"><strong class="schema-how-to-step-name">選擇匯入的資料類型<br/></strong> <p class="schema-how-to-step-text">在第一個畫面上點擊「取得資料」，就可以挑選想要匯入的資料類型，這篇文章先以匯入Excel 資料為例。<br/><img loading="lazy" decoding="async" width="1200" height="1318" src="https://i0.wp.com/aderlab.com/wp-content/uploads/02-input-data.png?fit=1200%2C1318&amp;ssl=1" class="attachment-full size-full" alt="" style="max-width: 100%; height: auto;" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/02-input-data.png?w=1200&amp;ssl=1 1200w, https://i0.wp.com/aderlab.com/wp-content/uploads/02-input-data.png?resize=273%2C300&amp;ssl=1 273w, https://i0.wp.com/aderlab.com/wp-content/uploads/02-input-data.png?resize=932%2C1024&amp;ssl=1 932w, https://i0.wp.com/aderlab.com/wp-content/uploads/02-input-data.png?resize=768%2C844&amp;ssl=1 768w" sizes="auto, (max-width: 708px) 100vw, 708px" /></p> </li><li class="schema-how-to-step" id="how-to-step-1661610593442"><strong class="schema-how-to-step-name">預覽資料並挑選要匯入的工作表<br/></strong> <p class="schema-how-to-step-text">在選擇好想要匯入的Excel之後，會有一個可以預覽資料內容的畫面，如果你想要匯入的 Excel 資料在不同的工作表的話，也可以像下圖這樣，一次把想要匯入的資料一次勾選起來。<br/><br/>在這個步驟，我會建議在選擇好匯入的工作表資料後，不要直接點選「載入」，建議可以點選「轉換資料」，原因是因為資料常常會需要整理後才能使用，所以點選「轉換資料」的話就可以在資料匯入 Power BI 之前做資料處理跟檢查，例如說檢查有沒有缺漏值、缺漏值有多少比例，會不會影響到資料的可分析性，又或是將資料的欄位格式更改成對的格式，確保欄位讀取到正確的欄位名稱等，這是在做所有數據分析之前必備的檢查流程。<br/><br/><img loading="lazy" decoding="async" width="2809" height="2236" src="https://i0.wp.com/aderlab.com/wp-content/uploads/03-data-preview-1.png?fit=2809%2C2236&amp;ssl=1" class="attachment-full size-full" alt="" style="max-width: 100%; height: auto;" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/03-data-preview-1.png?w=2809&amp;ssl=1 2809w, https://i0.wp.com/aderlab.com/wp-content/uploads/03-data-preview-1.png?resize=300%2C239&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/03-data-preview-1.png?resize=1024%2C815&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/03-data-preview-1.png?resize=768%2C611&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/03-data-preview-1.png?resize=1536%2C1223&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/03-data-preview-1.png?resize=2048%2C1630&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/03-data-preview-1.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/03-data-preview-1.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></p> </li><li class="schema-how-to-step" id="how-to-step-1661611032851"><strong class="schema-how-to-step-name">資料檢查與預處理<br/></strong> <p class="schema-how-to-step-text">資料處理比較不是本篇文章的重點，這邊簡單說一下常見的資料處理類型，等下次有機會再來細細分享怎麼操作。除了在第三個步驟講到的缺漏值、格式、欄位名稱外，也會檢查數據量、確認有沒有需要新增或是刪減的欄位、進行長寬資料的轉換(取消樞紐)，又或是統整同一個欄位的資料，像是統一大小寫、統一全形半形等。都沒有問題後就會按下左上角的「關閉並套用」。<br/><img loading="lazy" decoding="async" width="2814" height="1329" src="https://i0.wp.com/aderlab.com/wp-content/uploads/04-data-cleaning-1.png?fit=2814%2C1329&amp;ssl=1" class="attachment-full size-full" alt="" style="max-width: 100%; height: auto;" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/04-data-cleaning-1.png?w=2814&amp;ssl=1 2814w, https://i0.wp.com/aderlab.com/wp-content/uploads/04-data-cleaning-1.png?resize=300%2C142&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/04-data-cleaning-1.png?resize=1024%2C484&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/04-data-cleaning-1.png?resize=768%2C363&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/04-data-cleaning-1.png?resize=1536%2C725&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/04-data-cleaning-1.png?resize=2048%2C967&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/04-data-cleaning-1.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/04-data-cleaning-1.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></p> </li><li class="schema-how-to-step" id="how-to-step-1661610606690"><strong class="schema-how-to-step-name">成功匯入資料後會先進到畫布後，選擇左側到模組串接資料<br/></strong> <p class="schema-how-to-step-text">當資料匯入後，會先進入到一個空白的畫布，這個區塊就是讓我們可以任意拉報表與圖表的地方，但在拉報表前，要先確認我們需要使用到的資料有沒有做好了相關性連結。這時候需要點選左側欄的第三個小圖示「模型」。<br/><br/><img loading="lazy" decoding="async" width="2814" height="1627" src="https://i0.wp.com/aderlab.com/wp-content/uploads/05-data-import-sucess-1.png?fit=2814%2C1627&amp;ssl=1" class="attachment-full size-full" alt="" style="max-width: 100%; height: auto;" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/05-data-import-sucess-1.png?w=2814&amp;ssl=1 2814w, https://i0.wp.com/aderlab.com/wp-content/uploads/05-data-import-sucess-1.png?resize=300%2C173&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/05-data-import-sucess-1.png?resize=1024%2C592&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/05-data-import-sucess-1.png?resize=768%2C444&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/05-data-import-sucess-1.png?resize=1536%2C888&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/05-data-import-sucess-1.png?resize=2048%2C1184&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/05-data-import-sucess-1.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/05-data-import-sucess-1.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></p> </li><li class="schema-how-to-step" id="how-to-step-1661611716093"><strong class="schema-how-to-step-name">確認相關資料是否建立連結</strong> <p class="schema-how-to-step-text"><br/>Power BI 非常智能，如果你匯入的資料的欄位名稱一樣，系統就會自動幫你做好資料連結，就像下圖一樣，我們需要做的就是檢查欄位連結有沒有錯誤就好。那遇到欄位名稱不一樣怎麼辦？例如說一份資料銷售日期可能是寫OrderDate，另外一份資料則是寫訂單成立日期，這也沒關係，我們只要手動拉取相關聯的資料欄位，用拖拉的方式進行資料連結即可。<br/><br/><img loading="lazy" decoding="async" width="1684" height="1276" src="https://i0.wp.com/aderlab.com/wp-content/uploads/06-data-connection.png?fit=1684%2C1276&amp;ssl=1" class="attachment-full size-full" alt="" style="max-width: 100%; height: auto;" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/06-data-connection.png?w=1684&amp;ssl=1 1684w, https://i0.wp.com/aderlab.com/wp-content/uploads/06-data-connection.png?resize=300%2C227&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/06-data-connection.png?resize=1024%2C776&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/06-data-connection.png?resize=768%2C582&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/06-data-connection.png?resize=1536%2C1164&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/06-data-connection.png?w=1416&amp;ssl=1 1416w" sizes="auto, (max-width: 708px) 100vw, 708px" /></p> </li><li class="schema-how-to-step" id="how-to-step-1661611890358"><strong class="schema-how-to-step-name">拉取報表：初步了解<br/></strong> <p class="schema-how-to-step-text">資料處理完也做完兩份資料的連結後，就可以開始建立我們想要分析的項目了。我先以常見的表格為例，如果我想知道現在消費客戶的性別組成，我就可以在CustomerID資料表拉取gender當作資料列，然後在值的地方放入Sales跟Quantity，簡單的性別貢獻度就出來了，就像是Excel的樞紐分析功能一樣，如下圖所示。<br/><br/>但看了這份表格，我們可能會有疑惑，為什麼性別為 None 貢獻度還不少呢？是因為客戶都沒有填寫性別欄位的資料嗎？是因為資料有異常嗎？還是有其他的原因呢？<br/><br/><img loading="lazy" decoding="async" width="2809" height="1540" src="https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-2.png?fit=2809%2C1540&amp;ssl=1" class="attachment-full size-full" alt="" style="max-width: 100%; height: auto;" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-2.png?w=2809&amp;ssl=1 2809w, https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-2.png?resize=300%2C164&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-2.png?resize=1024%2C561&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-2.png?resize=768%2C421&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-2.png?resize=1536%2C842&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-2.png?resize=2048%2C1123&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-2.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-2.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></p> </li><li class="schema-how-to-step" id="how-to-step-1661611913424"><strong class="schema-how-to-step-name">拉取報表：深入探索<br/></strong> <p class="schema-how-to-step-text">當對數據有疑問時絕對不要放過，因為如果連資料分析的負責人都不知道數據呈現帶來的價值，那也很難對於部門或公司有實際的數據分析價值。<br/><br/>這時候，除了回頭去看原始資料外，我們也可以把其他客戶維度的資料拉進來幫助我們做判斷，像我因為熟悉資料，所以我就清楚知道是所有訂單中不僅僅有個人消費，也有公司消費跟家庭戶消費，這兩類的消費族群是團體，所以才會沒辦法以性別分類。<br/><br/>知道這些資料組成的細節，我們也會更知道怎麼在分析前先歸類分群，當我們想要分析客戶輪廓的時候，就知道一般客人與公司行號這類團體需要分開分析，這些從數據表面往下探究的的過程都會幫助我們更能提供貼近真實且有價值的分析內容。<br/><img loading="lazy" decoding="async" width="2809" height="1210" src="https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-1-1.png?fit=2809%2C1210&amp;ssl=1" class="attachment-full size-full" alt="" style="max-width: 100%; height: auto;" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-1-1.png?w=2809&amp;ssl=1 2809w, https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-1-1.png?resize=300%2C129&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-1-1.png?resize=1024%2C441&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-1-1.png?resize=768%2C331&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-1-1.png?resize=1536%2C662&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-1-1.png?resize=2048%2C882&amp;ssl=1 2048w, https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-1-1.png?w=1416&amp;ssl=1 1416w, https://i0.wp.com/aderlab.com/wp-content/uploads/08-data-diff-dimension-1-1.png?w=2124&amp;ssl=1 2124w" sizes="auto, (max-width: 708px) 100vw, 708px" /></p> </li></ol></div>



<p>那如何用 Power BI 建立資料連結的分享就到這裡了，希望這篇文章可以幫助到花費很多時間在使用 Excel Vlookup 公式中的你，文章最後也提供我整理過的原始資料檔案以及 Power BI 實作檔案給看過文章的你自由使用，歡迎動手實作看看，下篇文章見啦～</p>



<p>原始資料來源：<a href="https://community.tableau.com/s/question/0D54T00000CWeX8SAL/sample-superstore-sales-excelxls" target="_blank" rel="noreferrer noopener nofollow">https://community.tableau.com/s/question/0D54T00000CWeX8SAL/sample-superstore-sales-excelxls</a><br>資料下載連結：<a href="https://pse.is/4k9ujh" target="_blank" rel="noreferrer noopener">https://pse.is/4k9ujh</a>，雲端連結中共包括兩份檔案：<br>1. Power BI 示範檔案<br>2. Excel 電商資料檔案（這份資料的原始是從上面提供的原始資料來源而來，為了讓資料更貼近本篇文章的分析說明範例，所以有略為做客戶資料的新增跟標註）</p>



<p class="has-text-align-right">Sharon</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide"/>



<p class="has-medium-font-size"><strong>Buy me a coffee&nbsp; 用行動支持我的內容創作</strong></p>



<p><em>如果我的文章對你有幫助，歡迎用行動支持我的內容創作，小額贊助請我喝咖啡、留言或是寄信來跟我分享你的收穫，都會讓我持續有動力分享更多內容唷～</em></p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button aligncenter is-style-fill"><a class="wp-block-button__link has-black-color has-luminous-vivid-amber-background-color has-text-color has-background" href="https://www.buymeacoffee.com/aderlabsharon" target="_blank" rel="noreferrer noopener">以小額贊助支持Sharon</a></div>
</div>



<p></p>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-connect-data/">用 Power BI 取代 Vlookup 串接資料 輕鬆處理複雜資料分析</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4237</post-id>	</item>
		<item>
		<title>Microsoft Power BI 無法載入模型的 5 種常見原因與解決方案</title>
		<link>https://aderlab.com/data-analytics/power-bi-mistake/</link>
		
		<dc:creator><![CDATA[Sharon]]></dc:creator>
		<pubDate>Sun, 12 Jun 2022 13:17:02 +0000</pubDate>
				<category><![CDATA[Microsoft Power BI]]></category>
		<category><![CDATA[數據分析]]></category>
		<guid isPermaLink="false">https://aderlab.com/?p=3996</guid>

					<description><![CDATA[<p>你在使用 Microsoft Power BI 的時候也遇過「資料無法載入模型」或是「其他查詢的失敗導致無法載入」的提示嗎？如果你也有遇到這類的問題，這篇文章提供6種常見的原因，希望可以幫助你排解這兩個資料更新過程的常見困擾！</p>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-mistake/">Microsoft Power BI 無法載入模型的 5 種常見原因與解決方案</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>我在 <strong><a href="https://aderlab.com/data-analytics/power-bi-intro/" target="_blank" rel="noreferrer noopener">Microsoft Power BI 是什麼？談Power BI 的應用場景與功能簡介</a></strong> 這一篇談到，Micorsoft Power BI 可以透過更新資料夾內的 csv 或 excel 檔案來做到資料自動更新，並讓資料可以自動更新，套用到我們已經建立好的數據模板上。</p>



<p>不過，當我們在 Power BI 按下資料更新之後，有時候卻會跳出「無法載入模型」的警示，這是為什麼呢？到底是哪裡出了問題？這篇文章想跟你分享我過去在做資料分析過程中，使用Microsoft Power BI 自動更新過程常見的 5 種錯誤，這 5 種錯誤通常是導致無法載入模型的常見原因，一起看看吧！</p>



<h2 class="wp-block-heading">錯誤原因1： 變更資料存放的位置</h2>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/filemove_reminder.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="194" src="https://i0.wp.com/aderlab.com/wp-content/uploads/filemove_reminder.png?resize=708%2C194&#038;ssl=1" alt="" class="wp-image-3998" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/filemove_reminder.png?w=1002&amp;ssl=1 1002w, https://i0.wp.com/aderlab.com/wp-content/uploads/filemove_reminder.png?resize=300%2C82&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/filemove_reminder.png?resize=768%2C210&amp;ssl=1 768w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p><strong>Microsoft Power BI 在匯入資料的過程當中，會連帶把檔案存放的路徑記錄下來。以我匯入的資料為例，他紀錄的資料路徑就是：C:\Users\AppToGo\Desktop\power bi 資料庫\外部資料\superstore</strong></p>



<p>所以，如果我們在存放資料的時候沒有好好歸檔，或是在整理資料的過程中，不小心做了資料位置的更動，那麼<strong>Microsoft Power BI 當然就找不到資料，就不能將資料匯入BI報表了！</strong></p>



<h2 class="wp-block-heading">錯誤原因2：變更資料的格式</h2>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/format_reminder.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="161" src="https://i0.wp.com/aderlab.com/wp-content/uploads/format_reminder.png?resize=708%2C161&#038;ssl=1" alt="" class="wp-image-3999" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/format_reminder.png?w=1000&amp;ssl=1 1000w, https://i0.wp.com/aderlab.com/wp-content/uploads/format_reminder.png?resize=300%2C68&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/format_reminder.png?resize=768%2C175&amp;ssl=1 768w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p><strong>當我們更換資料格式的時候，例如說原本載入的檔案是excel的xls檔案，後面卻變成csv，那麼當然無法自動幫助你轉換資料格式。所以，當我們在建立檔案時，特別是未來要持續新增不同的檔案時，一開始就要確認哪一種資料格式是唯一的資料格式，未來就儘可能的不要做變動，就比較不會有無法載入資料的問題囉！</strong></p>



<h2 class="wp-block-heading">錯誤原因3：變更資料的欄位名稱、欄位數</h2>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/name_different_reminder.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="174" src="https://i0.wp.com/aderlab.com/wp-content/uploads/name_different_reminder.png?resize=708%2C174&#038;ssl=1" alt="" class="wp-image-4000" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/name_different_reminder.png?w=1002&amp;ssl=1 1002w, https://i0.wp.com/aderlab.com/wp-content/uploads/name_different_reminder.png?resize=300%2C74&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/name_different_reminder.png?resize=768%2C189&amp;ssl=1 768w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>如果你更換了檔案的欄位名稱或是把原本有的欄位刪除，例如說原本訂單ID的欄位名稱是Order Date，為了簡便就改成Date，那也會影響到資料的判讀，因為<strong>Microsoft Power BI 會發現原本的資料欄位為「Order Date」的欄位他找不到了，當然就沒辦法依照原本的資料清理步驟進行了。</strong></p>



<p>這邊需要注意的是，雖然提示錯誤的畫面只有寫找不到「Order Date」，但不代表錯誤的欄位只有一個，如果更改了一個以上的欄位名稱或是刪除了不只一個欄位，那還是要把所有更改過的名稱都改回原本的欄位名稱，以及復原所有的資料欄位，資料才能成功匯入。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">錯誤原因4：變更資料的檔案內的工作表名稱</h2>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/name_sheet_reminder.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="167" src="https://i0.wp.com/aderlab.com/wp-content/uploads/name_sheet_reminder.png?resize=708%2C167&#038;ssl=1" alt="" class="wp-image-4001" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/name_sheet_reminder.png?w=998&amp;ssl=1 998w, https://i0.wp.com/aderlab.com/wp-content/uploads/name_sheet_reminder.png?resize=300%2C71&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/name_sheet_reminder.png?resize=768%2C182&amp;ssl=1 768w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>如果調整了檔案內的工作表名稱，也會影響到<strong>Microsoft Power BI 的資料更新過程，例如說一開始的名稱是「工作表1」，為了好辨別更新成了「銷售表」，那麼下一次再做資料來源更換或是自動更新的時候就會讓 Microsoft Power BI 沒辦法判讀囉！</strong></p>



<h2 class="wp-block-heading">錯誤原因5：由於安全性問題，資料尚未允許被編輯</h2>



<figure class="wp-block-image size-full"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/safety-reminder.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="278" src="https://i0.wp.com/aderlab.com/wp-content/uploads/safety-reminder.png?resize=708%2C278&#038;ssl=1" alt="" class="wp-image-4002" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/safety-reminder.png?w=918&amp;ssl=1 918w, https://i0.wp.com/aderlab.com/wp-content/uploads/safety-reminder.png?resize=300%2C118&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/safety-reminder.png?resize=768%2C301&amp;ssl=1 768w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>這種情況通常來自於下載的資料來自於網際網路，來自網際網路的資料有時候系統會認為不安全，所以在你同意編輯之前會處於無法編輯的狀態，這時候也會讓<strong>Microsoft Power BI 沒辦法讀取資料，而產生無法載入資料的問題。這時候只需要開啟原始檔案，將原始檔案允許編輯，這樣這個問題就可以迎刃而解了。</strong></p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/excel-reminder.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="59" src="https://i0.wp.com/aderlab.com/wp-content/uploads/excel-reminder.png?resize=708%2C59&#038;ssl=1" alt="" class="wp-image-4003" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/excel-reminder.png?resize=1024%2C86&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/excel-reminder.png?resize=300%2C25&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/excel-reminder.png?resize=768%2C64&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/excel-reminder.png?resize=1536%2C128&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/excel-reminder.png?w=1580&amp;ssl=1 1580w, https://i0.wp.com/aderlab.com/wp-content/uploads/excel-reminder.png?w=1416&amp;ssl=1 1416w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<h2 class="wp-block-heading">如何避免上述錯誤發生？</h2>



<p>針對前 4 種經常發生的錯誤，我的建議作法是，只要是原始資料都不要做更動，我們可以在拿到資料之後，先將資料匯入<strong>Microsoft Power BI ，然後在Power BI 裡面統一使用Power Query來整理資料內容，在這個過程，不論是要新增資料欄位、修改資料名稱或是做計算處理都可以。</strong></p>



<p>這樣做<strong>最大的好處是，未來只要是一樣的資料格式，不論資料量多大，都可以按照過去我們設定過的資料整理方式自動清理資料，聽起來是不是超方便的呢？</strong></p>



<p>至於面對第5個常見錯誤，可以參考的作法有兩個，一個就是一旦有網路下載的資料來源，就在匯入到 BI 工具之前先開啟編輯。如果這麼做對你來說不太方便，且你可以確保未來網路資料下載的安全性的話，不妨可以考慮重新調整 EXCEL 裡面的信任中心取消對於網際網路或其他系統預設資料安全性的風險較高的資料保護檢視設定。</p>



<figure class="wp-block-image size-large"><a href="https://i0.wp.com/aderlab.com/wp-content/uploads/excel-trust-center.png?ssl=1"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="552" src="https://i0.wp.com/aderlab.com/wp-content/uploads/excel-trust-center.png?resize=708%2C552&#038;ssl=1" alt="" class="wp-image-4004" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/excel-trust-center.png?resize=1024%2C799&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/excel-trust-center.png?resize=300%2C234&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/excel-trust-center.png?resize=768%2C599&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/excel-trust-center.png?resize=1536%2C1198&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/excel-trust-center.png?w=1738&amp;ssl=1 1738w, https://i0.wp.com/aderlab.com/wp-content/uploads/excel-trust-center.png?w=1416&amp;ssl=1 1416w" sizes="auto, (max-width: 708px) 100vw, 708px" /></a></figure>



<p>以上 5 個是我曾經遇過，會影響資料來源無法順利載入、更換或是自動更新的的原因。你還有遇到什麼原因呢？有沒有這篇文章沒有提到的呢？歡迎在下方留言處與我分享。</p>



<p>這篇文章就分享到這裡，我們下篇文章見～</p>



<p class="has-text-align-right">Sharon</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide"/>



<p class="has-medium-font-size"><strong>Buy me a coffee&nbsp; 用行動支持我的內容創作</strong></p>



<p><em>如果我的文章對你有幫助，歡迎用行動支持我的內容創作，小額贊助請我喝咖啡、留言或是寄信來跟我分享你的收穫，都會讓我持續有動力分享更多內容唷～</em></p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button aligncenter is-style-fill"><a class="wp-block-button__link has-black-color has-luminous-vivid-amber-background-color has-text-color has-background" href="https://www.buymeacoffee.com/aderlabsharon" target="_blank" rel="noreferrer noopener">以小額贊助支持Sharon</a></div>
</div>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-mistake/">Microsoft Power BI 無法載入模型的 5 種常見原因與解決方案</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3996</post-id>	</item>
		<item>
		<title>Microsoft Power BI是什麼？談Power BI 的應用場景與功能簡介</title>
		<link>https://aderlab.com/data-analytics/power-bi-intro/</link>
		
		<dc:creator><![CDATA[Sharon]]></dc:creator>
		<pubDate>Tue, 17 May 2022 12:00:40 +0000</pubDate>
				<category><![CDATA[Microsoft Power BI]]></category>
		<category><![CDATA[數據分析]]></category>
		<guid isPermaLink="false">https://aderlab.com/?p=3911</guid>

					<description><![CDATA[<p>Power BI  是軟體服務、應用程式和連接器的集合，它們搭配使用來將不相關的資料來源轉換成相關、視覺上融入的互動式深入剖析。Power BI 讓我們能夠將日常工作自動化、建立有效率的工作流程，並作出資料驅動的決策。</p>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-intro/">Microsoft Power BI是什麼？談Power BI 的應用場景與功能簡介</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></description>
										<content:encoded><![CDATA[
<p>從今天開始有一個數據分析新單元：Microsoft Power BI，我在工作上使用 Microsoft Power BI 將近一年多的時間，真心覺得非常好用，靈光一閃，覺得好東西不可以只有我知道，於是發起了整理一個系列的想法，分享給持續關注部落格的朋友們～</p>



<p>今天是 POWER BI 系列的第一篇，來談談什麼是POWER BI ，以及我大力推薦哪些族群適合使用 POWER BI ，那麼我們就開始囉！</p>



<p></p>



<p>延伸閱讀<br>1.  <a href="https://aderlab.com/data-analytics/power-bi-mistake/" target="_blank" rel="noreferrer noopener">Microsoft Power BI 無法載入模型的 5 種常見原因與解決方案</a><br>2. <a href="https://aderlab.com/data-analytics/power-bi-connect-data/" target="_blank" rel="noreferrer noopener">用 Power BI  取代 VLOOKUP 串接資料 輕鬆處理複雜資料分析</a><br>3. <a href="https://aderlab.com/data-analytics/power-bi-auto-updating/" target="_blank" rel="noreferrer noopener">用 Power BI  自動更新數據，解決重複性資料整理</a><br>4. <a href="https://aderlab.com/data-analytics/power-bi-data-procedure-1/" target="_blank" rel="noreferrer noopener">5 個常見的 Power BI  資料處理功能介紹（上篇）</a><br>5. <a href="https://aderlab.com/data-analytics/power-bi-data-procedure-2/" target="_blank" rel="noreferrer noopener">5 個常見的 Power BI 資料處理功能介紹（下篇）</a><br>6. <a href="https://aderlab.com/data-analytics/power-bi-mistake/" target="_blank" rel="noreferrer noopener">Power BI </a><a href="https://aderlab.com/data-analytics/power-bi-chart-1/"> 圖表類型與應用場景：KPI卡片、資料表、長條圖與折線圖</a><br>7. <a href="https://aderlab.com/data-analytics/power-bi-chart-2/"></a><a href="https://aderlab.com/data-analytics/power-bi-chart-2/" target="_blank" rel="noreferrer noopener">Power BI  圖表類型與應用場景：用圓餅圖、瀑布圖與樹狀圖分析客戶</a><br>8. <a href="https://aderlab.com/data-analytics/power-bi-tableau-which-one-is-better/"></a><a href="https://aderlab.com/data-analytics/power-bi-tableau-which-one-is-better/" target="_blank" rel="noreferrer noopener">Power BI  V.S. Tableau：數據新手該學哪個 BI 工具比較好？</a></p>



<h2 class="wp-block-heading">什麼是 Microsoft POWER BI ？</h2>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>Power BI &nbsp;是軟體服務、應用程式和連接器的集合，它們搭配使用來將不相關的資料來源轉換成相關、視覺上融入的互動式深入剖析。Power BI&nbsp;讓我們能夠將日常工作自動化、建立有效率的工作流程，並作出資料驅動的決策。</p>
</blockquote>



<p>這句話是官方網站針對Microsoft <em>Power BI</em>&nbsp;的工具功能說明，我們在做判斷跟做決策的時候，很容易仰賴過往經驗或感覺來做決定，而有數據好處剛好就彌補了仰賴經驗或感覺做決策的問題，在溝通說服上也更容易站得住腳。</p>



<p>但用數據這件事情說起來容易，做起來卻不容易，原因是因為數據需要經過定義、蒐集、整理、轉換，才能轉化成對於商業決策有意義的決策依據，這個數據轉化與整理的過程，往往需要耗費大量的時間精力，以至於很多時候，我們不是不願意用數據，而是數據不夠完整、不夠即時或是太過於雜亂，以至於沒辦法在我們決策的時候幫上忙。</p>



<p>這個問題，也是過去我在幫忙整理數據、進行分析的一個大挑戰，所以啊，善用 BI 工具，讓系統自動運作，把複雜的數據轉換成簡單的表格、圖表，就是Microsoft Power BI&nbsp;最大的效用了！以雪倫的親身經歷是，我過往整理銷售資料的時候，大概至少要花一週左右的工作天來做數據下載、彙整、比對和套用計算公式，但是自從開始使用 Power BI&nbsp;工具之後，我可以在 10分鐘內做到數據更新，並且透過建立好的模板直接看到問題所在，這就是實務上使用 Power BI&nbsp;的超強效益。</p>



<h2 class="wp-block-heading">哪些工作內容 POWER BI 能幫上忙 ？</h2>



<p>如果你也是需要每日、每週或是每月整理數據報表的人，不妨可以考慮將 <em>Power BI</em>&nbsp;學起來，不僅可以幫助你提升工作效率，更能讓你可以有更多時間去思考數據背後的問題、準備怎麼對老闆、客戶進行簡報。</p>



<p>那麼哪些職務或是工作內容會大力推薦可以學習 POWER BI 呢？</p>



<h3 class="wp-block-heading">商業分析師或數據分析師</h3>



<p>身為職務大多數時候需要和數據為伍的職務，當然建議可以把POWER BI 這項工具學起來，一般來說對於商業分析師或資料分析師，BI工具應該算是入門的基本要求，如果你現在是主要使用 Tebleau的朋友，不妨也可以看看Microsoft推出的這款BI工具。</p>



<h3 class="wp-block-heading">常用Excel Vlookup比對資料</h3>



<p>受夠不停使用Vlookup比較來比較去了嗎？POWER BI 的資料比對只需要拖拉資料欄位標題即可完成，立刻解決不斷寫公式進行資料比對的無限循環。</p>



<h3 class="wp-block-heading">常用Excel製作數據圖表</h3>



<p>如果你是長期使用Excel彙整完資料，然後在Excel製作數據圖表，諸如折線圖、長條圖、散布圖等圖表，然後再貼到PPT進行彙整的朋友，POWER BI 也是一個很好的替代工具，一來是POWER BI 本身就可以當作簡報使用，而且比起固定式的圖表，他更具備互動式的效益，二來是POWER BI 的數據圖表選擇更多樣，我們可以透過圖表表達的資訊就會更多囉！</p>



<h3 class="wp-block-heading">常需做上期比較、同期比較</h3>



<p>常常要做同期、上一期的數據比較？比起自己手動去核對日期計算區間，不如考慮使用看看POWER BI 的 DAX函數，用 DATEADD 或是 <a href="https://docs.microsoft.com/zh-tw/dax/sameperiodlastyear-function-dax">SAMEPERIODLASTYEAR</a> 函數輕鬆解決自己整理公式、計算數據的困擾</p>



<h3 class="wp-block-heading">需要定期彙整數據報表</h3>



<p>常常需要每日、每週或每月彙整數據給客戶或老闆嗎？比起每一次都重新計算、重新拉報表、製作簡報，POWER BI 可以透過先建立好數據版型，後續只需要更新數據來源，再按下重新整理，就可以一鍵把最新的資料更新到數據報表上，讓例行報告製作更有效率。</p>



<h3 class="wp-block-heading">建立數據分析模型</h3>



<p>如RFM客戶模型、購物籃分析模型等 除了一般的數據彙整與報表功能，POWER BI 結合資料比對、DAX函數，讓 POWER BI 亦能進行比較複雜的數據判斷，例如說訂單的新舊客判斷、消費狀態判斷、回購率計算等，也因此商業上常常會看到的模型如RFM模型、購物籃分析模型等，都可以透過POWER BI 快速建立起來。</p>



<h2 class="wp-block-heading">POWER BI 有哪些強大功能 ？</h2>



<h3 class="wp-block-heading">數據比對，拖拉搞定</h3>



<p>下圖是Power BI用來做資料比對的介面，將不同資料匯入Power BI之後，就可以用拖拉的方式，將不同資料來源，但是有關聯性的欄位做資料比對，例如說把訂單資料List of Orders的「日期」串接到日期資料表dDate，又或是把詳細訂單明細Order Details 的「Order ID」與訂單資料List of Orders的「Order ID」，讓我們可以透過串接，後續可以分析訂單的銷售商品名稱、銷售數量、銷售總金額等細部資料。</p>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" loading="lazy" decoding="async" width="708" height="330" src="https://i0.wp.com/aderlab.com/wp-content/uploads/power-bi-connection.png?resize=708%2C330&#038;ssl=1" alt="" class="wp-image-3915" srcset="https://i0.wp.com/aderlab.com/wp-content/uploads/power-bi-connection.png?resize=1024%2C478&amp;ssl=1 1024w, https://i0.wp.com/aderlab.com/wp-content/uploads/power-bi-connection.png?resize=300%2C140&amp;ssl=1 300w, https://i0.wp.com/aderlab.com/wp-content/uploads/power-bi-connection.png?resize=768%2C359&amp;ssl=1 768w, https://i0.wp.com/aderlab.com/wp-content/uploads/power-bi-connection.png?resize=1536%2C717&amp;ssl=1 1536w, https://i0.wp.com/aderlab.com/wp-content/uploads/power-bi-connection.png?w=1658&amp;ssl=1 1658w, https://i0.wp.com/aderlab.com/wp-content/uploads/power-bi-connection.png?w=1416&amp;ssl=1 1416w" sizes="auto, (max-width: 708px) 100vw, 708px" /></figure>



<h3 class="wp-block-heading">數據更新，一鍵完成</h3>



<p>下圖是我將訂單資料彙整在同一個電腦的資料夾當中，Power BI的資料源串接，除了資料庫、單個檔案的Excel、CSV之外，Power BI 還可以鎖定資料夾串接，也就是說，當你想要更新5月份的資料時，你只需要把5月份的資料，丟進Power BI 串接的資料夾，並在Power BI 的報表上方按下「重新整理」，那麼5月份的資料就會連同你過去做過的資料整理步驟、數據計算等設定，都一起更新到Power BI的報表了。</p>



<h3 class="wp-block-heading">Query 幫助進行數據整理</h3>



<p>空白值處理、檔案格式定義、欄位內容調整，取消樞紐分析表格等，Power Query 都可以幫助整理我們初步的做資料整理，最重要的是，如果你需要做固定的資料清理步驟，下一次只需要更換資料檔案，同樣的資料清理步驟就不需要再重複進行一次囉！</p>



<h3 class="wp-block-heading">DAX函數，方便計算</h3>



<p>DAX是我在操作Power BI過程中，覺得相對複雜，比較需要花多一點時間學習、演練才有辦法上手的功能，不過雖然偏複雜，但是他能做到的計算跟比對也非常強大，簡單一點的功能包括：加減乘除、去年同期比較等，複雜一點的則包括訂單客人的新舊客狀態判斷、四分位數計算等。</p>



<h3 class="wp-block-heading">互動式報表，數據因應篩選動態變動</h3>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<div class="jetpack-video-wrapper"><iframe loading="lazy" title="互動式報表範例" width="708" height="398" src="https://www.youtube.com/embed/s3W-0NFPX6w?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe></div>
</div><figcaption class="wp-element-caption">資料來源：<a href="https://www.kaggle.com/" target="_blank" rel="noreferrer noopener">Kaggle</a></figcaption></figure>



<p>當然POWER BI 不僅僅可以用在上述提到的這些地方，基本上只要有數據整理、數據分析或是圖表化的工作需求，POWER BI 都可以派上用場，這一篇希望讓大家對 POWER BI 是什麼有一個基本的認識，如果你想要開始使用POWER BI 的話，可以到官方下載區，下載 Power BI Desktop 免費使用，唯一的限制是，目前這個工具只有Windows環境可以使用，算是目前美中不足的地方，那就下篇文章見囉～</p>



<p></p>



<p class="has-text-align-right">Sharon</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide"/>



<p class="has-medium-font-size"><strong>Buy me a coffee&nbsp; 用行動支持我的內容創作</strong></p>



<p><em>如果我的文章對你有幫助，歡迎用行動支持我的內容創作，小額贊助請我喝咖啡、留言或是寄信來跟我分享你的收穫，都會讓我持續有動力分享更多內容唷～</em></p>



<div class="wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex">
<div class="wp-block-button aligncenter is-style-fill"><a class="wp-block-button__link has-black-color has-luminous-vivid-amber-background-color has-text-color has-background wp-element-button" href="https://www.buymeacoffee.com/aderlabsharon" target="_blank" rel="noreferrer noopener">以小額贊助支持Sharon</a></div>
</div>
<p>這篇文章 <a href="https://aderlab.com/data-analytics/power-bi-intro/">Microsoft Power BI是什麼？談Power BI 的應用場景與功能簡介</a> 最早出現於 <a href="https://aderlab.com">Sharon Lab∣雪倫實驗室</a>。</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3911</post-id>	</item>
	</channel>
</rss>
