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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
vkomarag
Helper III
Helper III

Same formula for multiple columns

I have a 300 columns in a file. 200 columns has a value of ratings. I need to calculate something out of it(say some formula).The same formula i need to apply to those 200 columns. Right now i see that we have to create a new measure for every corresponding column.200 measures has to be created.In case in the future,if there are 100 more similar columns got added,then i need to create 100 more measures.

 

Is there anyway in Power BI to have a formula once and apply it everywhere required?

 

Appreciate your response.

 

Thanks

KVB

2 REPLIES 2
dedelman_clng
Community Champion
Community Champion

You can try unpivoting your data so that each column becomes a row, with the "column type" as a column.

 

Name  C1 C2  C3 C4 C5 C6

A     A  B  C  D  E  F

 

becomes

 

Name  ColType   Value

A         1              A

A         2              B

A         3              C

A         4              D

A         5              E

A         6              F

 

 

and you can then add a calcualted column against "Value".

 

Hope this helps

David

Anonymous
Not applicable

I think it is VERY likely you should reshape your data -- using Get & Transform to unpivot your data.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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