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
slhyrkl
Regular Visitor

Need help to split multiple values in one column for the duplicated rows.

As shown in the picture I attached, Timage (1).pnghere is one part (part no 127316) has multiple values in the next column. I want to split those values into different columns based on the same part no. 78.96% is the current month's value and 53,51% is the last month's value and I want to create two different columns as "Current month", "Last month" and split these values into these columns. I have multiple parts that have multiple percentages but some of the parts only have one percentage. The upper value (78.96% ) is the current month and the below value (53,51%) is the last months value. This is the case for the other part numbers too. My main goal is to show the data like this and calculate the difference between months if there are values for two months for a part. How can I transform the data to achieve this?

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@slhyrkl 

actually i don't suggest you to pivot table. 

 

you can create a column

Column =
VAR a=minx(FILTER('Table','Table'[c]=EARLIER('Table'[c])&&'Table'[d]<EARLIER('Table'[d])),'Table'[d])
return if(CALCULATE(count('Table'[d]),ALLEXCEPT('Table','Table'[c]))=1,"Current",if(ISBLANK(a),"last","Current"))
 
11.PNG
 
then you can create a measure to calcualte difference
Measure = CALCULATE(sum('Table'[d]),'Table'[Column]="Current") - CALCULATE(sum('Table'[d]),'Table'[Column]="last")
 
12.PNG
 
pls see the attachment below

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ryan_mayu
Super User
Super User

@slhyrkl 

actually i don't suggest you to pivot table. 

 

you can create a column

Column =
VAR a=minx(FILTER('Table','Table'[c]=EARLIER('Table'[c])&&'Table'[d]<EARLIER('Table'[d])),'Table'[d])
return if(CALCULATE(count('Table'[d]),ALLEXCEPT('Table','Table'[c]))=1,"Current",if(ISBLANK(a),"last","Current"))
 
11.PNG
 
then you can create a measure to calcualte difference
Measure = CALCULATE(sum('Table'[d]),'Table'[Column]="Current") - CALCULATE(sum('Table'[d]),'Table'[Column]="last")
 
12.PNG
 
pls see the attachment below

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.