SlideShare a Scribd company logo
1 of 8
How to create
A Top 5 Measure
in Power BI
Top 5 in a Measure
Although Power BI has
an built-in Top N filter
feature
It is often useful to be
able to show that value
as a measure and what
percent of the whole it
represents
This guide shows you
how to do it
Step by Step
Create a measure to
aggregate sales for the
top 5 products
We create a Variable to
identify the top 5
products, and a
separate variable to
aggregate the sales
amount
This makes the DAX
easier to follow
Top 5 Products Sales =
VAR TopNProducts =
TOPN (
5,
SUMMARIZE(Sales,
'Product'[Product],"SALESVALUE",sum(Sales[Sales Amount])),
[SALESVALUE],desc
)
VAR Result =
CALCULATE (
SUM(Sales[Sales Amount]),
TopNProducts
)
RETURN Result
DAX Breakdown
SUMMARIZE creates subtotals, in this case a column with each ‘Product’
and a second column for the total sales
SUMMARIZE(Sales, 'Product'[Product],"SALESVALUE",sum(Sales[Sales
Amount]))
TOPN – The ‘5’ sets how many top rows to return
We use the summarise row to define the data rows (see above)
The last row defines the field to sort by (SALESVALUE in Descending order)
TOPN (
5,
SUMMARIZE(Sales, 'Product'[Product],"SALESVALUE",sum(Sales[Sales
Amount])),
[SALESVALUE],desc
DAX Breakdown
Next we calculate the Sum of Sales for each Product in the Top N products
VAR Result =
CALCULATE (
SUM(Sales[Sales Amount]),
TopNProducts
)
Top X in a Measure
We have then used this
measure on a card to
highlight how much of the
total the top X products
represent
We added a simple
secondary measure showing
what percentage this is
We then created similar for
the bottom 20 products
And Finally added these to
the chart
Hope you find these useful
For more Tips, Tricks and
Timesavers, visit our website
Tips and Timesavers | Select Distinct Limited
Credit: simon.harrison@selectdistinct.co.uk

More Related Content

Similar to Power BI Tips Top N Measures.pptx

Cost Volume Profit Analysis.pptx
Cost Volume Profit Analysis.pptxCost Volume Profit Analysis.pptx
Cost Volume Profit Analysis.pptxsakshikwatra6
 
Devry bis-155-final-exam-guide-new
Devry bis-155-final-exam-guide-newDevry bis-155-final-exam-guide-new
Devry bis-155-final-exam-guide-newshyaminfo104
 
Bca i fma u 4.1 cost -volume-profit analysis
Bca i fma u 4.1 cost -volume-profit analysisBca i fma u 4.1 cost -volume-profit analysis
Bca i fma u 4.1 cost -volume-profit analysisRai University
 
Mca i fma u 4.1 cost -volume-profit analysis
Mca i fma u 4.1 cost -volume-profit analysisMca i fma u 4.1 cost -volume-profit analysis
Mca i fma u 4.1 cost -volume-profit analysisRai University
 
Bba ii cost and management accounting u 4.1 cost -volume-profit analysis
Bba ii cost and management accounting u 4.1 cost -volume-profit analysisBba ii cost and management accounting u 4.1 cost -volume-profit analysis
Bba ii cost and management accounting u 4.1 cost -volume-profit analysisRai University
 
Mca & bca i fma u 4.1 cost -volume-profit analysis
Mca & bca i fma u 4.1 cost -volume-profit analysisMca & bca i fma u 4.1 cost -volume-profit analysis
Mca & bca i fma u 4.1 cost -volume-profit analysisRai University
 
How to create pivot table in excel
How to create pivot table in excelHow to create pivot table in excel
How to create pivot table in excelAashirJamil
 
Cost volume profit analysis
Cost volume profit analysisCost volume profit analysis
Cost volume profit analysisNazar Mohammed
 
1.12 using breakeven analysis to make decisions
1.12 using breakeven analysis to make decisions1.12 using breakeven analysis to make decisions
1.12 using breakeven analysis to make decisionssdwaltton
 
How to Sharpen Your Investigative Analysis with PowerPivot
How to Sharpen Your Investigative Analysis with PowerPivotHow to Sharpen Your Investigative Analysis with PowerPivot
How to Sharpen Your Investigative Analysis with PowerPivotCarmen Mardiros
 
Operating Leverage.pdf
Operating Leverage.pdfOperating Leverage.pdf
Operating Leverage.pdfShreya292338
 
Operating Leverage.pdf
Operating Leverage.pdfOperating Leverage.pdf
Operating Leverage.pdfShreya292338
 
Dervy bis 155 final exam guide music on demand new
Dervy  bis 155 final exam guide  music on demand  newDervy  bis 155 final exam guide  music on demand  new
Dervy bis 155 final exam guide music on demand newkxipvscsk02
 
Adding measures to Calcite SQL
Adding measures to Calcite SQLAdding measures to Calcite SQL
Adding measures to Calcite SQLJulian Hyde
 
Empowerment Technology Lesson 4
Empowerment Technology Lesson 4Empowerment Technology Lesson 4
Empowerment Technology Lesson 4alicelagajino
 
Cost and Management Accounting II Chapter 1.pdf
Cost and Management Accounting II Chapter 1.pdfCost and Management Accounting II Chapter 1.pdf
Cost and Management Accounting II Chapter 1.pdfalemayehu73
 
Pass 2018 introduction to dax
Pass 2018 introduction to daxPass 2018 introduction to dax
Pass 2018 introduction to daxIke Ellis
 

Similar to Power BI Tips Top N Measures.pptx (20)

Cost Volume Profit Analysis.pptx
Cost Volume Profit Analysis.pptxCost Volume Profit Analysis.pptx
Cost Volume Profit Analysis.pptx
 
Devry bis-155-final-exam-guide-new
Devry bis-155-final-exam-guide-newDevry bis-155-final-exam-guide-new
Devry bis-155-final-exam-guide-new
 
Bca i fma u 4.1 cost -volume-profit analysis
Bca i fma u 4.1 cost -volume-profit analysisBca i fma u 4.1 cost -volume-profit analysis
Bca i fma u 4.1 cost -volume-profit analysis
 
Mca i fma u 4.1 cost -volume-profit analysis
Mca i fma u 4.1 cost -volume-profit analysisMca i fma u 4.1 cost -volume-profit analysis
Mca i fma u 4.1 cost -volume-profit analysis
 
Bba ii cost and management accounting u 4.1 cost -volume-profit analysis
Bba ii cost and management accounting u 4.1 cost -volume-profit analysisBba ii cost and management accounting u 4.1 cost -volume-profit analysis
Bba ii cost and management accounting u 4.1 cost -volume-profit analysis
 
Mca & bca i fma u 4.1 cost -volume-profit analysis
Mca & bca i fma u 4.1 cost -volume-profit analysisMca & bca i fma u 4.1 cost -volume-profit analysis
Mca & bca i fma u 4.1 cost -volume-profit analysis
 
How to create pivot table in excel
How to create pivot table in excelHow to create pivot table in excel
How to create pivot table in excel
 
Cost volume profit analysis
Cost volume profit analysisCost volume profit analysis
Cost volume profit analysis
 
SQL Tips Calculate Running Totals.pptx
SQL Tips Calculate Running Totals.pptxSQL Tips Calculate Running Totals.pptx
SQL Tips Calculate Running Totals.pptx
 
Marginal costing
Marginal costingMarginal costing
Marginal costing
 
1.12 using breakeven analysis to make decisions
1.12 using breakeven analysis to make decisions1.12 using breakeven analysis to make decisions
1.12 using breakeven analysis to make decisions
 
How to Sharpen Your Investigative Analysis with PowerPivot
How to Sharpen Your Investigative Analysis with PowerPivotHow to Sharpen Your Investigative Analysis with PowerPivot
How to Sharpen Your Investigative Analysis with PowerPivot
 
Operating Leverage.pdf
Operating Leverage.pdfOperating Leverage.pdf
Operating Leverage.pdf
 
Operating Leverage.pdf
Operating Leverage.pdfOperating Leverage.pdf
Operating Leverage.pdf
 
Dervy bis 155 final exam guide music on demand new
Dervy  bis 155 final exam guide  music on demand  newDervy  bis 155 final exam guide  music on demand  new
Dervy bis 155 final exam guide music on demand new
 
Adding measures to Calcite SQL
Adding measures to Calcite SQLAdding measures to Calcite SQL
Adding measures to Calcite SQL
 
Empowerment Technology Lesson 4
Empowerment Technology Lesson 4Empowerment Technology Lesson 4
Empowerment Technology Lesson 4
 
Cost and Management Accounting II Chapter 1.pdf
Cost and Management Accounting II Chapter 1.pdfCost and Management Accounting II Chapter 1.pdf
Cost and Management Accounting II Chapter 1.pdf
 
Pass 2018 introduction to dax
Pass 2018 introduction to daxPass 2018 introduction to dax
Pass 2018 introduction to dax
 
Ppt12
Ppt12Ppt12
Ppt12
 

More from Select Distinct Limited

Year on Year Comparison in Power BI.pptx
Year on Year Comparison in Power BI.pptxYear on Year Comparison in Power BI.pptx
Year on Year Comparison in Power BI.pptxSelect Distinct Limited
 
Sync Slicers in Power BI a step by step guide
Sync Slicers in Power BI a step by step guideSync Slicers in Power BI a step by step guide
Sync Slicers in Power BI a step by step guideSelect Distinct Limited
 
Using Google Search Console Data in Power BI.pptx
Using Google Search Console Data in Power BI.pptxUsing Google Search Console Data in Power BI.pptx
Using Google Search Console Data in Power BI.pptxSelect Distinct Limited
 
Data Lake v Data Warehouse. What is the difference?
Data Lake v Data Warehouse. What is the difference?Data Lake v Data Warehouse. What is the difference?
Data Lake v Data Warehouse. What is the difference?Select Distinct Limited
 
How to Create Drop Down Lists in Excel, step by step
How to Create Drop Down Lists in Excel, step by stepHow to Create Drop Down Lists in Excel, step by step
How to Create Drop Down Lists in Excel, step by stepSelect Distinct Limited
 
Top 5 SQL Tips and Timesaver 2023, our most popular posts
Top 5 SQL Tips and Timesaver 2023, our most popular postsTop 5 SQL Tips and Timesaver 2023, our most popular posts
Top 5 SQL Tips and Timesaver 2023, our most popular postsSelect Distinct Limited
 
Top 5 Power BI tips 2023 most popular blog posts
Top 5 Power BI tips 2023 most popular blog postsTop 5 Power BI tips 2023 most popular blog posts
Top 5 Power BI tips 2023 most popular blog postsSelect Distinct Limited
 
When to transform data for Power BI.pptx
When to transform data for Power BI.pptxWhen to transform data for Power BI.pptx
When to transform data for Power BI.pptxSelect Distinct Limited
 
Direction of travel on a map in Power BI.pptx
Direction of travel on a map in Power BI.pptxDirection of travel on a map in Power BI.pptx
Direction of travel on a map in Power BI.pptxSelect Distinct Limited
 
Power BI Connect to Google BigQuery.pptx
Power BI Connect to Google BigQuery.pptxPower BI Connect to Google BigQuery.pptx
Power BI Connect to Google BigQuery.pptxSelect Distinct Limited
 

More from Select Distinct Limited (20)

Year on Year Comparison in Power BI.pptx
Year on Year Comparison in Power BI.pptxYear on Year Comparison in Power BI.pptx
Year on Year Comparison in Power BI.pptx
 
Sync Slicers in Power BI a step by step guide
Sync Slicers in Power BI a step by step guideSync Slicers in Power BI a step by step guide
Sync Slicers in Power BI a step by step guide
 
Using Google Search Console Data in Power BI.pptx
Using Google Search Console Data in Power BI.pptxUsing Google Search Console Data in Power BI.pptx
Using Google Search Console Data in Power BI.pptx
 
Data Lake v Data Warehouse. What is the difference?
Data Lake v Data Warehouse. What is the difference?Data Lake v Data Warehouse. What is the difference?
Data Lake v Data Warehouse. What is the difference?
 
How to Create Drop Down Lists in Excel, step by step
How to Create Drop Down Lists in Excel, step by stepHow to Create Drop Down Lists in Excel, step by step
How to Create Drop Down Lists in Excel, step by step
 
Top 5 SQL Tips and Timesaver 2023, our most popular posts
Top 5 SQL Tips and Timesaver 2023, our most popular postsTop 5 SQL Tips and Timesaver 2023, our most popular posts
Top 5 SQL Tips and Timesaver 2023, our most popular posts
 
Top 5 Power BI tips 2023 most popular blog posts
Top 5 Power BI tips 2023 most popular blog postsTop 5 Power BI tips 2023 most popular blog posts
Top 5 Power BI tips 2023 most popular blog posts
 
CTEs in SQL.pptx
CTEs in SQL.pptxCTEs in SQL.pptx
CTEs in SQL.pptx
 
Divide by Zero Errors
Divide by Zero ErrorsDivide by Zero Errors
Divide by Zero Errors
 
When to transform data for Power BI.pptx
When to transform data for Power BI.pptxWhen to transform data for Power BI.pptx
When to transform data for Power BI.pptx
 
Power BI KPIs
Power BI KPIsPower BI KPIs
Power BI KPIs
 
Direction of travel on a map in Power BI.pptx
Direction of travel on a map in Power BI.pptxDirection of travel on a map in Power BI.pptx
Direction of travel on a map in Power BI.pptx
 
UNION in DAX
UNION in DAXUNION in DAX
UNION in DAX
 
APPEND data in Power Query
APPEND data in Power QueryAPPEND data in Power Query
APPEND data in Power Query
 
Power BI Connect to Google BigQuery.pptx
Power BI Connect to Google BigQuery.pptxPower BI Connect to Google BigQuery.pptx
Power BI Connect to Google BigQuery.pptx
 
Group by ROLLUP in SQL Server
Group by ROLLUP in SQL ServerGroup by ROLLUP in SQL Server
Group by ROLLUP in SQL Server
 
Custom Formats in Power BI
Custom Formats in Power BICustom Formats in Power BI
Custom Formats in Power BI
 
SQL Tips UNPIVOT Function.pptx
SQL Tips UNPIVOT Function.pptxSQL Tips UNPIVOT Function.pptx
SQL Tips UNPIVOT Function.pptx
 
Power BI Drill Through
Power BI Drill ThroughPower BI Drill Through
Power BI Drill Through
 
How to PIVOT in SQL
How to PIVOT in SQLHow to PIVOT in SQL
How to PIVOT in SQL
 

Recently uploaded

Sensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
Sensing the Future: Anomaly Detection and Event Prediction in Sensor NetworksSensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
Sensing the Future: Anomaly Detection and Event Prediction in Sensor NetworksBoston Institute of Analytics
 
Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshareraiaryan448
 
社内勉強会資料  Mamba - A new era or ephemeral
社内勉強会資料   Mamba - A new era or ephemeral社内勉強会資料   Mamba - A new era or ephemeral
社内勉強会資料  Mamba - A new era or ephemeralNABLAS株式会社
 
Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024patrickdtherriault
 
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证ppy8zfkfm
 
MATERI MANAJEMEN OF PENYAKIT TETANUS.ppt
MATERI  MANAJEMEN OF PENYAKIT TETANUS.pptMATERI  MANAJEMEN OF PENYAKIT TETANUS.ppt
MATERI MANAJEMEN OF PENYAKIT TETANUS.pptRachmaGhifari
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证acoha1
 
Atlantic Grupa Case Study (Mintec Data AI)
Atlantic Grupa Case Study (Mintec Data AI)Atlantic Grupa Case Study (Mintec Data AI)
Atlantic Grupa Case Study (Mintec Data AI)Jon Hansen
 
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证ju0dztxtn
 
Abortion Clinic in Randfontein +27791653574 Randfontein WhatsApp Abortion Cli...
Abortion Clinic in Randfontein +27791653574 Randfontein WhatsApp Abortion Cli...Abortion Clinic in Randfontein +27791653574 Randfontein WhatsApp Abortion Cli...
Abortion Clinic in Randfontein +27791653574 Randfontein WhatsApp Abortion Cli...mikehavy0
 
一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理pyhepag
 
How to Transform Clinical Trial Management with Advanced Data Analytics
How to Transform Clinical Trial Management with Advanced Data AnalyticsHow to Transform Clinical Trial Management with Advanced Data Analytics
How to Transform Clinical Trial Management with Advanced Data AnalyticsBrainSell Technologies
 
2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group Meeting2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group MeetingAlison Pitt
 
Formulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfFormulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfRobertoOcampo24
 
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...ssuserf63bd7
 
Bios of leading Astrologers & Researchers
Bios of leading Astrologers & ResearchersBios of leading Astrologers & Researchers
Bios of leading Astrologers & Researchersdarmandersingh4580
 
Audience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxAudience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxStephen266013
 
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证dq9vz1isj
 
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...ThinkInnovation
 

Recently uploaded (20)

Sensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
Sensing the Future: Anomaly Detection and Event Prediction in Sensor NetworksSensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
Sensing the Future: Anomaly Detection and Event Prediction in Sensor Networks
 
Seven tools of quality control.slideshare
Seven tools of quality control.slideshareSeven tools of quality control.slideshare
Seven tools of quality control.slideshare
 
社内勉強会資料  Mamba - A new era or ephemeral
社内勉強会資料   Mamba - A new era or ephemeral社内勉強会資料   Mamba - A new era or ephemeral
社内勉強会資料  Mamba - A new era or ephemeral
 
Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024Northern New England Tableau User Group (TUG) May 2024
Northern New England Tableau User Group (TUG) May 2024
 
123.docx. .
123.docx.                                 .123.docx.                                 .
123.docx. .
 
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
1:1原版定制利物浦大学毕业证(Liverpool毕业证)成绩单学位证书留信学历认证
 
MATERI MANAJEMEN OF PENYAKIT TETANUS.ppt
MATERI  MANAJEMEN OF PENYAKIT TETANUS.pptMATERI  MANAJEMEN OF PENYAKIT TETANUS.ppt
MATERI MANAJEMEN OF PENYAKIT TETANUS.ppt
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
 
Atlantic Grupa Case Study (Mintec Data AI)
Atlantic Grupa Case Study (Mintec Data AI)Atlantic Grupa Case Study (Mintec Data AI)
Atlantic Grupa Case Study (Mintec Data AI)
 
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
如何办理英国卡迪夫大学毕业证(Cardiff毕业证书)成绩单留信学历认证
 
Abortion Clinic in Randfontein +27791653574 Randfontein WhatsApp Abortion Cli...
Abortion Clinic in Randfontein +27791653574 Randfontein WhatsApp Abortion Cli...Abortion Clinic in Randfontein +27791653574 Randfontein WhatsApp Abortion Cli...
Abortion Clinic in Randfontein +27791653574 Randfontein WhatsApp Abortion Cli...
 
一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理一比一原版阿德莱德大学毕业证成绩单如何办理
一比一原版阿德莱德大学毕业证成绩单如何办理
 
How to Transform Clinical Trial Management with Advanced Data Analytics
How to Transform Clinical Trial Management with Advanced Data AnalyticsHow to Transform Clinical Trial Management with Advanced Data Analytics
How to Transform Clinical Trial Management with Advanced Data Analytics
 
2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group Meeting2024 Q2 Orange County (CA) Tableau User Group Meeting
2024 Q2 Orange County (CA) Tableau User Group Meeting
 
Formulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdfFormulas dax para power bI de microsoft.pdf
Formulas dax para power bI de microsoft.pdf
 
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...
Data Visualization Exploring and Explaining with Data 1st Edition by Camm sol...
 
Bios of leading Astrologers & Researchers
Bios of leading Astrologers & ResearchersBios of leading Astrologers & Researchers
Bios of leading Astrologers & Researchers
 
Audience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptxAudience Researchndfhcvnfgvgbhujhgfv.pptx
Audience Researchndfhcvnfgvgbhujhgfv.pptx
 
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
1:1原版定制伦敦政治经济学院毕业证(LSE毕业证)成绩单学位证书留信学历认证
 
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
Identify Rules that Predict Patient’s Heart Disease - An Application of Decis...
 

Power BI Tips Top N Measures.pptx

  • 1. How to create A Top 5 Measure in Power BI
  • 2. Top 5 in a Measure Although Power BI has an built-in Top N filter feature It is often useful to be able to show that value as a measure and what percent of the whole it represents This guide shows you how to do it
  • 3. Step by Step Create a measure to aggregate sales for the top 5 products We create a Variable to identify the top 5 products, and a separate variable to aggregate the sales amount This makes the DAX easier to follow Top 5 Products Sales = VAR TopNProducts = TOPN ( 5, SUMMARIZE(Sales, 'Product'[Product],"SALESVALUE",sum(Sales[Sales Amount])), [SALESVALUE],desc ) VAR Result = CALCULATE ( SUM(Sales[Sales Amount]), TopNProducts ) RETURN Result
  • 4. DAX Breakdown SUMMARIZE creates subtotals, in this case a column with each ‘Product’ and a second column for the total sales SUMMARIZE(Sales, 'Product'[Product],"SALESVALUE",sum(Sales[Sales Amount])) TOPN – The ‘5’ sets how many top rows to return We use the summarise row to define the data rows (see above) The last row defines the field to sort by (SALESVALUE in Descending order) TOPN ( 5, SUMMARIZE(Sales, 'Product'[Product],"SALESVALUE",sum(Sales[Sales Amount])), [SALESVALUE],desc
  • 5. DAX Breakdown Next we calculate the Sum of Sales for each Product in the Top N products VAR Result = CALCULATE ( SUM(Sales[Sales Amount]), TopNProducts )
  • 6. Top X in a Measure We have then used this measure on a card to highlight how much of the total the top X products represent We added a simple secondary measure showing what percentage this is We then created similar for the bottom 20 products And Finally added these to the chart
  • 7. Hope you find these useful
  • 8. For more Tips, Tricks and Timesavers, visit our website Tips and Timesavers | Select Distinct Limited Credit: simon.harrison@selectdistinct.co.uk