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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Automatically Select and update latest four columns to data table

Hi,

I want to update the latest four columns of data automatically on my dashboard. When I update the next date to my excel data base dashboard should select the latest four data columns and publish in on the dashboard. column names are dates as follows

 

 

Pramoduw_0-1663084223498.png

 

 

1 ACCEPTED SOLUTION

hi again 

i have creat 2 example in power query: 

onurbmiguel__0-1663145068447.png

 

Example 1:

onurbmiguel__1-1663145105651.png

 

example 2:

onurbmiguel__2-1663145122554.png

 

 

you can use the same link to view the pbix. 

 

Best regards

Bruno Costa | Responsive Resident

 

Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 👍

Take a look at the blog: PBI Portugal 

wp-1586527108426

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thanks onurbmiguel,

Can I select the latest four columns while I selecting column from excel power query editor?

hi again 

i have creat 2 example in power query: 

onurbmiguel__0-1663145068447.png

 

Example 1:

onurbmiguel__1-1663145105651.png

 

example 2:

onurbmiguel__2-1663145122554.png

 

 

you can use the same link to view the pbix. 

 

Best regards

Bruno Costa | Responsive Resident

 

Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 👍

Take a look at the blog: PBI Portugal 

wp-1586527108426

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


Anonymous
Not applicable

Thanks Bruno👍

onurbmiguel_
Power Participant
Power Participant

Hello, 

You need to change your model.
Unpivot the data columns, to have something like this:

onurbmiguel__0-1663084794969.png

 

Example of power query: 

 

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("tdO5FcAgEMTQXjYmYMbgowE3waP/NiCjgVWg9GcaI35Fidxm2awZ9mLYxrCdYW+GfRj2ZdiPYVUhN9c8LjSaoNMErSboNUGzCbpN0G6CfjP0m3PN40K/GfrN0G8GfpsL", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Object " = _t, #"4/7/2022" = _t, #"4/8/2022" = _t, #"4/9/2022" = _t, #"4/10/2022" = _t, #"4/11/2022" = _t, #"4/12/2022" = _t, #"4/13/2022" = _t, #"4/14/2022" = _t, #"4/15/2022" = _t, #"4/16/2022" = _t, #"4/17/2022" = _t, #"4/18/2022" = _t, #"4/19/2022" = _t, #"4/20/2022" = _t, #"4/21/2022" = _t, #"4/22/2022" = _t, #"4/23/2022" = _t, #"4/24/2022" = _t, #"4/25/2022" = _t, #"4/26/2022" = _t]),
    #"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {"Object "}, "date", "Value"),
    #"Changed Type" = Table.TransformColumnTypes(#"Unpivoted Columns",{{"date", type date}})
in
    #"Changed Type"

 

 

Also the pbix with this example: Unpivot.pbix

 

https://1drv.ms/u/s!AkcWVrMFkXs1h7NSMjQ64mxTamhKZw?e=X60LNn

 

output:

onurbmiguel__1-1663085222587.png

 

 

 

Best regards

Bruno Costa | Responsive Resident

 

Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 👍

Take a look at the blog: PBI Portugal 

 

wp-1586527108426

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.