Forum Discussion

windylee's avatar
windylee
Frequent Visitor
1 year ago

How to display different content on a table / matrix based on different date is selected?

Hi, I am new to Power BI. I have different sets of data as follows:

 

1. Item Price Table

ItemPrice £Date (Year Month)
Green Apple102024-01
Ice Cream62024-01
MacBook8002024-01
Red Apple52024-01
Trousers502024-01
TV12002024-01
Green Apple82024-02
Ice Cream6002024-02
MacBook10002024-02
Red Apple52024-02
TV10002024-02
Chips32024-02
T-shirt502024-02
Flip-flops72024-02

 

2. Mapping Table

ItemCategorySub Category
Green AppleFoodFruit
Ice CreamFoodFrozen Food
MacBookAppliancesLaptop
Red AppleFoodFruit
TrousersClothesBottom
TVAppliancesTV
ChipsFoodSnacks
T-shirtClothesTop
Flip-flopsClothesShoes

 

3. Category Table 

CategorySub Category 1Sub Category 2Sub Category 3
FoodFruitFrozen FoodSnacks
ClothesTopBottomShoes
AppliancesLaptopTVVacuum

 

4. Colour & Order of both Category & Sub Cat. by Date

AttributeContentOrderColourDate (Year Month)
CategoryFood1G2024-01
Sub Category 1Fruit2G2024-01
Sub Category 2Frozen Food3G2024-01
Sub Category 3Snacks4Y2024-01
CategoryClothes5Y2024-01
Sub Category 1Top6Y2024-01
Sub Category 2Bottom7G2024-01
Sub Category 3Shoes8Y2024-01
CategoryAppliances9R2024-01
Sub Category 1Laptop10R2024-01
Sub Category 2TV11Y2024-01
Sub Category 3Vacuum12R2024-01
CategoryClothes13G2024-02
Sub Category 1Top14Y2024-02
Sub Category 2Bottom15G2024-02
Sub Category 3Shoes16G2024-02
CategoryAppliances17R2024-02
Sub Category 1Laptop18R2024-02
Sub Category 2TV19R2024-02
Sub Category 3Vacuum20Y2024-02
CategoryFood21R2024-02
Sub Category 1Fruit22R2024-02
Sub Category 2Frozen Food23R2024-02
Sub Category 3Snacks24R2024-02

 

Expected outcome shown in the Power BI report

 

The combination of the Category & Sub Categories are always the SAME, but the colours & the order will be different based on different date.

 

Problems I am facing

I am unable to make such table / matrix to display the expected outcome.

I have difficulites to create relationship between the tables because there are circulation.

I don't know how to do conditional formatting based on different date.

I also have no idea on how to create the matrix with the different content & order.

 

Do I need to create another data source table & unpivot other columns something like that? Many thanks for your help!

2 Replies

  • Repeating the same data in the same visual is a design red flag. Using SubCategory1, SubCategory2 and SubCategory3 will paint you into a corner - just imagine the maintenance effort when SubCategory4 comes along.

     

    What are the color coding rules?

     

     

    • windylee's avatar
      windylee
      Frequent Visitor

      Deeply sorry for my late response. Thank you very much for your help.

      I used some other ways to complete this.