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.
Hello everyone,
Currently I have this data source:
I want to alter it into the following:
Is there a way to achieve this in Power Query? If not, is it possible in BI using DAX?
Thank you.
Solved! Go to Solution.
Hi @primolee
please check out the function that I've written for it here: https://www.thebiccountant.com/2017/12/11/date-datesbetween-retrieve-dates-between-2-dates-power-bi-...
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @primolee ,
We can create a custom column in power query editor and expand it to rows to meet your requiremnet:
List.Dates([WeekStart],Duration.Days([WeekEnd]-[WeekStart])+1,#duration(1,0,0,0))
All the queries are here:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwtNQ31TdU0oExTYHMEDOlWB24pBlC0tAIJGuqFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [WeekStart = _t, WeekEnd = _t, #"week name" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"WeekStart", type date}, {"WeekEnd", type date}, {"week name", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Date", each List.Dates([WeekStart],Duration.Days([WeekEnd]-[WeekStart])+1,#duration(1,0,0,0))),
#"Expanded Date" = Table.ExpandListColumn(#"Added Custom", "Date")
in
#"Expanded Date"
Best regards,
Hi @primolee
please check out the function that I've written for it here: https://www.thebiccountant.com/2017/12/11/date-datesbetween-retrieve-dates-between-2-dates-power-bi-...
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hello both,
Thank you so much, both of you!
Both are the solutions to my question, it is super difficult for me to decide whose answer to accept.
Dong's solution is very simple, whereas ImkeF's solution gives more flexibility of display by different interval.
I will accept ImkeF's reply as solution, but again, both work perfectly.
Thank you both for taking the time to help, greatly appreciated!
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
54 | |
21 | |
12 | |
11 |