Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
erolyucel65
Frequent Visitor

Create a dynamic chart from a dataset

I have a dataset consisted a key column (K1), 10 attributes columns (A1,A2,...,A10) and four values columns (V1,V2,V3,V4). My ultimate goal is to create a 4-column dynamic table with fixed names (Key, Attribute One, Attribute Two, Value) by using field parameters or any other way. How can I achieve this goal? 

 

K1A1A2A3A4A5A6A7A8A9A10V1V2V3V4
               

 

From this dataset, I want to create a dynamic table shown below to use in creating visuals (As an example A2,A4, V3 will be changed dynamically

to create a dynamic chart with a dynamic axis and legend.

 

Key    Attribute One   Attribute Two     Value
K1 Info           A2 Info         A4 Info     V3 Info

 

I appreciate a solution in PBIX file, if possible. Thank you

4 REPLIES 4
erolyucel65
Frequent Visitor

 @Ritaf1983 @amitchandak @Ashish_Mathur would like to invite you for review of my problem. Thank you

AmiraBedh
Super User
Super User

First Unpivot data in Power Query by selecting all the attribute columns (A1 to A10) you want to unpivot.
Choose to "Unpivot Columns" to transform your columns into two columns  one for the attribute names (Attribute) and one for the attribute values (Value).

Then create slicers for attribute and value selection.
- Add slicers to your report page by selecting the "Slicer" visualization.
- Use one slicer for selecting attributes (A1, A2, ...), based on the AttributeName column you created.
- Add slicers for each value column (V1, V2, V3, V4).

Now comes the DAX part for your dynamic behaviour :
Create a measure that uses the selected slicer values to determine which attribute and value to display :

Dynamic Value =
VAR SelectedAttribute = SELECTEDVALUE(Slicer[AttributeName])
VAR SelectedValue = SELECTEDVALUE(Slicer[ValueColumn], "V1") // Default to V1 if no selection
RETURN
CALCULATE(
MAX(Table[AttributeValue]),
Table[AttributeName] = SelectedAttribute,
Table[SelectedValue]
)

Then create a table that compiles the selected key, attributes, and values into a structure that can be easily displayed:

Dynamic Table =
ADDCOLUMNS(
VALUES(Table[K1]),
"Key", Table[K1],
"Attribute One", [Dynamic Attribute One],
"Attribute Two", [Dynamic Attribute Two],
"Value", [Dynamic Value]
)

Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Dynamic Value =
VAR SelectedAttribute = SELECTEDVALUE(Slicer[AttributeName]) 
VAR SelectedValue = SELECTEDVALUE(Slicer[ValueColumn], "V1") // Default to V1 if no selection
RETURN
CALCULATE(
MAX(Table[AttributeValue]),
Table[AttributeName] = SelectedAttribute,
Table[SelectedValue]
)
I could not get selected values from the slicers.It gives me error saying It could not find the AtrributeName and ValueColumn.

I will check it right now, thank you for your quick return.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.