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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
slhyrkl
Frequent 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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