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
mouzicanat
Frequent Visitor

Unpivot Issue Eliminates Rows

Hi,

 

This is my first post and I am new to Power BI, so pelase bear with me.

I have a data set I am pulling from Smartsheet and mainly trying to work out a line graph with two lines (two dates). My X axis are to be dates (months), and my Y axis are $ amount. I want there to be two lines for each type of date, but can't seem to make it work.

After reading other forums, it looks like I need to unpivot my two date columns, BUT, that causes a majority of my rows to disappear from the query. And also gives me an error after I hit 'apply'.

 

Could anyone help here please?

 

I'm guessing the error is because I am pulling data and it can't work out where to put it when I unpivot my columns.

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Ok great.  Looks like you won't need to unpivot.  A date table might do the trick and make use of what is discussed in this video:

 

https://www.youtube.com/watch?v=2BxaUXlx3K4

 

Basically, make a date table, link to both dates where 1 relationship will be inactive.  Then you create 2 measures and one of the measures makes use of the inactive link with the DAX function called "USE RELATIONSHIP"

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Without seeing the data its going to be hard to recommend what your issue it.  Whether you need to unpivot the data will entirely depend on whether the data itself is in a pivoted format.

 

 

 

For your example, you simply need a data source where you have the values you want to sum, the date column and then a 3rd column that is the distingishing category to split the data into the 2 boxes.

 

If your data was in 2 tables, you would instead just have 2 separate columns of data to sum, but would need to like both tables through a date table.

Hi Ross,

 

Thank you for responding and sorry for not including details!

Here is a link to my dataset, and all columns are in the same table that is actively refreshed.

 

Let me know if any further details are needed.

 

Thank you!

 

 

Anonymous
Not applicable

Sadly my organisations security policy prevents me from opening outside files like that.  Hopefully someone else can assist.

Hi, it's basically the following:

Date1Date2Total$
11/20/201812/3/201815585
11/29/201812/17/20184650
11/15/201811/26/201826455
11/20/201812/3/20187488
12/24/20181/18/201928235
12/17/20181/9/201912402
11/26/201812/10/20181464
12/3/201812/17/20184320
12/20/20181/16/20195040
12/17/20181/9/20195460
11/15/201811/26/20181917
12/7/201812/21/201849508.5
12/7/201812/31/201810380

 

Aanything helps!

Anonymous
Not applicable

Ok great.  Looks like you won't need to unpivot.  A date table might do the trick and make use of what is discussed in this video:

 

https://www.youtube.com/watch?v=2BxaUXlx3K4

 

Basically, make a date table, link to both dates where 1 relationship will be inactive.  Then you create 2 measures and one of the measures makes use of the inactive link with the DAX function called "USE RELATIONSHIP"

Thank you so much Ross! This was really helpful and worked for me, althought I still don't understand fully how Cat LOL

I should add, that I also had no idea how to create date tables and this site really made it easy for me: https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi hopefully it can help the next person.

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.