Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Visual with Slicer and Switch Help Request

Still very new to PBI / Dax and beating my head against a wall... I am creating a bar chart visual in PBI that will display the following on their own bar in the chart. I am looking to slice these ba...
  • techies's avatar
    1 year ago

    Hi Anonymous as i understand, please try this,

     

    after defining your measures for example, like this

    Invoices Accepted =
    CALCULATE (
    SUM ( Invoices[Amount ($)] ),
    NOT ISBLANK ( Invoices[Submitted Date] ),
    NOT ISBLANK ( Invoices[Accepted Date] ),
    TREATAS ( VALUES ( Period[ContractYear_ID] ), 'Date'[ContractYear_ID] ),
    USERELATIONSHIP ( Invoices[Accepted Date], 'Date'[Date] )
    )

     

    repeat for submitted, deposited and so on

     

    then create a disconnected table

     

    Category = DATATABLE (
    "Category", STRING,
    {
    { "Submitted" },
    { "Accepted" },
    { "Deposited" },
    { "Paid" }
    }
    )

     

    and the measure  as this Invoice Amount by Category =
    SWITCH (
    SELECTEDVALUE ( Category[Category] ),
    "Submitted", [Invoices Submitted],
    "Accepted", [Invoices Accepted],
    "Deposited", [Invoices Deposited],
    "Paid", [Invoices Paid]
    )