Forum Discussion

H-D's avatar
H-D
New Member
4 years ago
Solved

Adding Slicer by Pie Chart Value

Hi,    I have a dataset with various columns, to simplify for the core purpose of my question, the 4 relevant columns are: 1) Building Name 2) Vacant/occupied 3) # of Units 4) Area (Sq. Ft.)  ...
  • MahyarTF's avatar
    4 years ago

    Hi,

    - In Power Query, Create a duplicated of the current table (...(2))

    - In the main table Create a column (name itFlag) and put the "Area (Sq. Ft.)" fix value in it

    - Create a copy of the "Area" column 

    - in the duplicate table, do it based on the "# of units" :

    - Append both tables :

    - Add the new Column for the Append table as below :

    = Table.AddColumn(Source, "Value(Area-#Unit)", each (if [#"Area (Sq. Ft.) - Copy"] <> null then [#"Area (Sq. Ft.) - Copy"] else 0) + (if[#"# of Units - Copy"] <> null then [#"# of Units - Copy"] else 0))

    - Now in Power BI :

    - Create Slicer based on the Flag field :

    - And pie Chart on 'Vacant/Occupied' and 'Value(Area-#uint)