MSPowerBI: Difference between revisions
(→DAX) |
|||
| Line 34: | Line 34: | ||
=====DAX Studio===== | |||
* https://towardsdatascience.com/handling-blank-in-power-bi-90eed948d042 | * https://towardsdatascience.com/handling-blank-in-power-bi-90eed948d042 | ||
Revision as of 08:58, 4 July 2024
Information
- extension for local saves is *.pbix
Concepts
- What is Power BI
- https://docs.microsoft.com/de-de/power-bi/guidance/star-schema
- There are three different options on how your data should be treated: Import, DirectQuery, or Live Connection. This section will focus specifically on the Import option.
Relationsships
Import aspects are:
- Auto-detected relationships
- There may be only one active relationship between two tables
- There may be an unlimited number of in-active relationships between two tables
- Relationships may only be built on a single column, not multiple columns
- Relationships automatically filter from the one side of the relationship to the many side Relationships cannot be built directly between tables that have a many-to-many relationship
- Cross-Filtering means a filter from a 1-to-many and many-to-1 relationship like filter on one dimension table to filter another dimension table via a fact table
The arrows defines the direction of filtering:
Hierachies
Modelling Organizational Hierachies
- https://ssbi-blog.de/blog/business-topics/wie-du-unregelmaessige-hierarchien-in-power-bi-und-power-pivot-nutzen-solltest/ fixed number of levels
- https://www.daxpatterns.com/parent-child-hierarchies/
- https://radacad.com/parsing-organizational-hierarchy-or-chart-of-accounts-in-power-bi-with-parent-child-functions-in-dax with two columns representing a parent relationship
- https://radacad.com/removing-blanks-from-organizational-ragged-hierarchy-in-power-bi-matrix-visual
- https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi
Calculated Columns
ES Activity Order = RELATED('ES Activity Order'[ES Activity Order])
Measures
DAX Studio
Data Types
- In PowerBI there are data types and data formats
- Dates
- Numbers
- Whole Numbers
- Fixed Decimals
- Decimal Numbers (most commonly used)
- Text
Operation
Import Data from Excel
General Information
Power Query Editor always works with a preview of the data, to make the development process fast. When you load the data in Power BI, transformations will be applied on the entire dataset. Hence errors might have not been identified before the full import of data.
Steps
Define Import
- select import and file
- select transform (not load)
Delete Rows e.g. Header
Add Columns
- see https://docs.microsoft.com/de-de/power-bi/transform-model/desktop-tutorial-create-calculated-columns
- example
= Table.AddColumn(#"Geänderter Typ", "Charge Fact", each if Value.Is([#"Chargeability (FTE)#(lf)"], type number) then [#"Chargeability (FTE)#(lf)"] else 1)
= Table.AddColumn(#"Geänderter Typ2", "Activity Type", each if [#"Partner-PSP-Element"] = "9914.P10048.004" then "ES Admin" else if [#"Partner-PSP-Element"] = "9914.P10048.005" then "ES Training" else if [#"Partner-PSP-Element"] = "9914.P10048.006" then "ES Relationship Management" else "tbd")
= Table.AddColumn(#"Renamed Columns1", "Initials", each Text.Start([First Name], 1) & Text.Start([Last Name], 1))
Delete Rows
- filter specific value (click to right down arrow in the column header and define the filter)
N charactors from left
Adjust Query
- Show Query Settings File:Screenshot 2024-04-21 151120.png
Not summing up a column like personnel number
Error Handling
- example see here
- remove all rows with an error in one column

- remove all rows with an error in any column

- replace errors in one column -> Replace Errors

Export Data to Excel
Relationsships
Change Default Summarization
Visuals
General Properties
Filter on Visuals
Show Selection Pane for Grouping
- you need to select at least 2 visuals to have the context menu 'group'
- to avoid overlapping visuals put them in different groups
Sorting according to Values
ES Activity Order = RELATED(ES_Activity_Order[ES Activity Order])
Slicer
Matrix
- is neary the same as pivot
- https://www.goodly.co.in/create-pivot-table-in-power-bi/
- grand total and subtotals
Mulit-Row Card
- Title On/Off: caption of multi-row card on top
- Visual Data -> Fields -> Right Click -> Rename for this visual: text below number
- Visual Data -> Category Label On/Off: show text below number
- Visual Data -> Category Label: format of text below number
Pie Chart
- sequence of fields defines the position, starts at 00:00
- Format -> Visual -> Legend -> Position
- Format -> Visual -> Slices -> Colors
Single Card
- 'Collout value' -> Font: size of number
- 'Category label' on/off: text below number
- 'Title': text above number
Stacked Bar Chart
100% Stacked Column Chart
Stacked Column Chart
- show 0 values
Table
Show Duplicates
Projects
ES KPI Reporting
- Table for Activity Sorting: Report View -> Enter Data -> ... and edit it via these steps
English/German
| Slicer | Datenschnitt |
| E1 | G1 |
| E2 | G2 |