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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Seabastein
Frequent Visitor

Unpivot without keeping zeros

Hello,

I have a table with articles and the quantities sold are in different column for each month of the year.

When i unpivot them I obtain a quantity of rows containing only zeros and wanted to know if there is a way to filter them during the process, since I tried to filter them afterwards and ended up with 30 minutes wait for it to load into the model.

 

The table before

Seabastein_0-1634303515789.png

 

 

Here is what it looks like afterwards with the code

 

= Table.Unpivot(#"Colonnes permutées", {"Qte Janvier", "Qte Février", "Qte Mars", "Qte Avril", "Qte Mai", "Qte Juin", "Qte Juillet", "Qte Août", "Qte Septembre", "Qte Octobre", "Qte Novembre", "Qte Décembre"}, "Attribut", "Valeur")

 

 

 

Seabastein_2-1634306915198.png

 

Thanks in advance for the help 👍

Sebastien

 

 

1 ACCEPTED SOLUTION
speedramps
Super User
Super User

Please consider this solution and click the thumbs up icon for me just trying to help you and click ACCEPT SOLUTION if it fixes your problem. Thank you ! 

 

Option 1)

Go back to the data sorce (eg SQL view) and send the data will null instead of 0.

The unpivot will then run much faster.

 

Option 2)

Select columns Jan to Dec and replace 0 with null before doing the unpivot 

View solution in original post

2 REPLIES 2
speedramps
Super User
Super User

Please consider this solution and click the thumbs up icon for me just trying to help you and click ACCEPT SOLUTION if it fixes your problem. Thank you ! 

 

Option 1)

Go back to the data sorce (eg SQL view) and send the data will null instead of 0.

The unpivot will then run much faster.

 

Option 2)

Select columns Jan to Dec and replace 0 with null before doing the unpivot 

AlexisOlson
Super User
Super User

I think if you replace 0 with null in all of the columns you intend to unpivot, then those values won't show up after unpivoting.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Fabric Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.