Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
Need help dax formula or else.
My query that I wanted are, create a table to generate dates per each attribute.
From Month as start date to End Date
Each attributes needs a start to end dates in a separate table.
Exmp.
RES 01/01/2020 475
RES 01/02/2020 475
...
..
RES 01/31/2020 475
ENTERPRIZE ELITE 01/01/2020 1022
ENTERPRIZE ELITE 01/02/2020 1022
..
..
ENTERPRIZE ELITE 01/31/2020 1022
Big help for me.
Hi, @Anonymous , I prefer Power Query to DAX in terms of such data transformation. You may want to follow this pattern.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjIwMtA1MAQiJR2lINdgBVcPFyDLxNwUSMIkjQ2VYnXQ1LrmlaQWFRRlFqcquOZklqQChQwNjIzQdMUCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [StartDate = _t, Attribute = _t, Value = _t, EndDate = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"StartDate", type date}, {"Attribute", type text}, {"Value", Int64.Type}, {"EndDate", type date}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each List.Dates([StartDate], Duration.Days([EndDate]-[StartDate])+1, #duration(1,0,0,0))),
#"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom")
in
#"Expanded Custom"
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@CNENFRNL
Thanks for your code, however I just copy paste your codes.
And I'm having an error on "Added Custom". I dont know if I'm getting the right list.date
THanks for having this
Hi, @Anonymous , there are some glithes in your code; pls change them like this,
#"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each List.Dates([StartDate], Duration.Days(Date.EndOfMonth([StartDate])-[StartDate])+1, #duration(1,0,0,0))),
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Can I used that your query? may I know how I can edit the table you created?.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |