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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
DatenThielt
New Member

Dropdown of Columns to select date range

Afternoon All,  I have a Table that contains about 10 fields,  and about 100,000 records  All fields are the same with exception to the parent

parentID, CreatedDate, ReceivedDate, OrderDate, HoldDate, etc

 

I want to be able to select one of these from a drop down, then adjust a date from and to, to display how many records reside on this date.

parentID is a Unique field and when I tried something recommended in another post (Unpivot the Columns)  This resulted in an error about the Unique field.  I'm just wondering if there is another way?

 

Thanks!

6 REPLIES 6
freginier
Impactful Individual
Impactful Individual

What's the error you have when you unpivot column ? 

I think the easiest way is to have two columns ParentID and Date (with all dates) 

When I unpivot I get the error that ParentID is unique and cannot have duplicate values.   I could do the above but with 100000 records of a parent ID an date thats going to be huge,  will that not cause performance issues?

 

Thank you for the Response!

Hi @DatenThielt ,

 

You can remove duplicate rows before unpivot and It is inevitable that a large dataset will affect the report performance.

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I unpivot 2 122 872 rows with this script...

let
    Source = Excel.Workbook(File.Contents("test.xlsx"), null, true),
    Sheet1 = Source{[Item="Feuil1",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(Sheet1, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"ID", Int64.Type}, {"Col1", type date}, {"Col2", type date}, {"Col3", type date}}),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"ID"}, "Attribute", "Value")
in
    #"Unpivoted Columns"

 

Can we see your data ? 

 

My data is pretty simple,   My only issue is its running from an ODBC source not spreadsheet, but considering it grabs the data fine it should be fine.

 

PrimaryKeyParentIDdateNewdateUnitReceiveddateUnitCollecteddateUnitPartsdateHelddatePartsReceiveddateUnitShippeddateUnitResolved
<GUID><INT>

<dateTime>

yyyy-MM-dd hh:mm:ss 

<DateTime as before>etcetc    

What's happen if you apply the script above ? 

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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