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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
m92240
Frequent Visitor

Duplicate a line

Hello guys,

 

I would like to get some help with the report I built.

 

I have built Dax measure on Potential ID to calculate a sum based on the year. Unfornately some Potential ID have both amounts calculated on "this year" and "next year".

It is why I'am looking how I can duplicate some lines based on Potential ID.

I would like for example to duplicate "zcrm_1803507000001707007" in two lines. 

 

Do you know how to do it ?

 

m92240_0-1635405667387.png

 

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @m92240 ,

Based on the information you provided, you did not provide specifics on how to determine which data is to be duplicated. You can create a table with the data that needs to be added using calculatetable and the filter criteria, and then use Union to merge the original table with the new table.

vluwangmsft_0-1635754819326.pngvluwangmsft_1-1635754828455.png

refer:https://community.powerbi.com/t5/Desktop/How-do-I-duplicate-rows-based-on-cell-contents-cell-contain... 

 

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


Best Regards

Lucien

 

amitchandak
Super User
Super User

@m92240 , You can use time intelligence with date table .

 

example

 

YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
Last YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(dateadd('Date'[Date],-1,Year),"12/31"))
This year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR('Date'[Date]),"12/31"))
Last year Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD(ENDOFYEAR(dateadd('Date'[Date],-1,Year)),"12/31"))

 

 

Power BI — Year on Year with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-ytd-questions-time-intelligence-1-5-e3174b39f38a
https://www.youtube.com/watch?v=km41KfM_0uA
P

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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