Forum Discussion

cgpahnk's avatar
cgpahnk
Frequent Visitor
2 years ago
Solved

Dynamic Field Parameter Not Working

Hello,

 

I am somewhat new to Power BI and these forums, but I'll try to convey my issue the best I can.

 

My goal is to have a dynamic graph for the Y value of each different Supplier Product Size over the span of every Week Year, but when I go to create a field parameter of these values and insert it, any selections made will not work.

 

The graph on the left is what I want to display with my selection, the right graph is my dynamic parameter graph with the field parameter slicer underneath.

 

 

This is what my source data looks like:

-I did have to transpose this data within power query if that is of any signifance.

 

Wk YrWk 31 2021Wk 32 2021Wk 33 2021Wk 34 2021Wk 35 2021Wk 36 2021Wk 37 2021Wk 38 2021Wk 39 2021Wk 40 2021Wk 41 2021Wk 42 2021Wk 43 2021Wk 44 2021Wk 45 2021Wk 46 2021Wk 47 2021Wk 48 2021Wk 49 2021Wk 50 2021Wk 51 2021Wk 52 2021
Supplier 125 ML3335688742224554333225
Supplier 220 ML101087534457764222368887
Supplier 500 ML1111221111221111100110
Supplier 1000 ML0000001110000000001001
Supplier Cap1089101191110111212121211131391311151515
Supplier 8oz691095344333322456544610
Supplier 10oz1232433220222312346421

 

Also a snippet of what my data looks like after Power Query transformation:

 

I would greatly appreciate any help anyone can give!

  • Hello cgpahnk ,

     

    My advice would be using unpivot in power query to get the data in the following format:

     

     

    Once you have the data like that you can insert a slicer referencing the field "Product" so you can filter the product you want to see in the graph

     

6 Replies

  • Hello cgpahnk ,

     

    My advice would be using unpivot in power query to get the data in the following format:

     

     

    Once you have the data like that you can insert a slicer referencing the field "Product" so you can filter the product you want to see in the graph

     

    • cgpahnk's avatar
      cgpahnk
      Frequent Visitor

      Okay I might be really picking your brain here, but from these changes are you able to change the color of the column based on whether it exceeded the target or not (Like red for under and green for over)? Even after filtering with new target lines?

      • gadielsolis's avatar
        gadielsolis
        Resolver III

        Hello, Sorry for the late response.

         

        You can use the following DAX:

         

        And then create a conditional formatting for the columns:

         

         

         

  • cgpahnk's avatar
    cgpahnk
    Frequent Visitor

    gadielsolis much appreciated! I think this will work. Only issue I have now is ordering the graph by date but I can probably create a date table for that.

     

    Do you think I'd be able to have a dynamic target line that changes for each filter selection?

    • gadielsolis's avatar
      gadielsolis
      Resolver III

      My advice would be create a separate table with the products and the target for each product (you can create it in excel or within power BI), after that you can connect both tables using the product field and add the target as a line in the grap). Find below some screenshots for reference

       

      Important: In the slicer you must use the product field coming from the targets table since this will be your key value.