0
votes

I have two raw data tables:

  1. Stores_base that contains detailed informations about all company stores enter image description here

  2. Sales_transactions that contains all registered sales transactions from all the stores that sold something: enter image description here

Now, I need to create POWER BI dashboard that will allow final user to see whole store base with sales values for each store ( 0 or "-" for stores without any sales). The tricky part for me, is that there has to be possibiity to filter sales results by slicers added to the dashboard. So final result would look silimar to this (created in excel): enter image description here

So far i only did this kind of transformations in excel, which is relativelly easy. But in Power BI i am not sure how to achive what i need.

I already have solid basics with Power Query data transformations in M Language and writing DAX measures - not very complexed though.

1

1 Answers

1
votes

Use the following DAX expression to achieve your goal:

Amount = 
VAR __sum = SUM( Sales_transactions[sales_amount] )
Return
    IF(
        NOT( ISBLANK( __sum ) ),
        __sum,
        "-" 
    )

The same for value:

Value = 
VAR __sum = SUM( Sales_transactions[sales_value] )
Return
    IF(
        NOT( ISBLANK( __sum ) ),
        __sum,
        "-" 
    )

This will allow you to show a "-" if there is no value and to keep your table if you select any filter.

Here are some examples: enter image description here

enter image description here