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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

automatically modify a measure with a segment/filter on the name of the column

hello,

 

i think that is a very commun question, but i don't know how to find it...

i have a lot of column which correspond of different parameters.

For one column (so for one parameter) i did few new measures (as the summation and the difference of the average and the standart deviation of my parameter merge by day). But now i want to apply these new measures for each column automatically (not by hand). So i want my column name to be a variable... by this way, with the segment/filter on the column name the measure and the curve will change too.

 

I put a schema (i hope it is clear... i don't know how to explain easily) :

vadim_g_1-1638196162604.png

 

Thanks a lot

 

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

In Power Query, select your [Date] column in your parameter table, go to Transform tab > Unpivot Columns (dropdown) > Unpivot Other Columns. This will put all of your column names into an [Attribute] column, and each of your parameter values into a [Value] column. You can change the names of these columns to suit your use by overtyping them in the M code seen in the formula bar on the unpivot step.

This is the correct/optimum data structure for use with Power BI.

 

In your report, write your measure referring to the [Value] column, and use the [Attribute] column in your slicer.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

In Power Query, select your [Date] column in your parameter table, go to Transform tab > Unpivot Columns (dropdown) > Unpivot Other Columns. This will put all of your column names into an [Attribute] column, and each of your parameter values into a [Value] column. You can change the names of these columns to suit your use by overtyping them in the M code seen in the formula bar on the unpivot step.

This is the correct/optimum data structure for use with Power BI.

 

In your report, write your measure referring to the [Value] column, and use the [Attribute] column in your slicer.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Anonymous
Not applicable

of course !!! rolala my bad... unpivot is really cool when we use an old and badly thought table.

thanks, i accept your solution =D

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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