Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I want to pull the data for the two measures. For the first measure, I want to pull the data for the past month from the 0th Column. I created first measure1. And for the second measure, I want to pull from columns 1 to 12. For example, for the second measure, if I want to see the data for July month (199 in this case), it must show in the second column and respectively until December. I unpivoted columns from 0 to 12. What DAX code do I need to use it here? So that I able to satisfy requirement
Hi @Anonymous ,
Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.
Best Regards
Lucien
First step is to unpivot your data to bring it into usable format.
Please provide sanitized sample data that fully covers your issue. If you paste the data into a table in your post or use one of the file services it will be easier to assist you. I cannot use screenshots of your source data.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523
Hello I unpivoted data in Power Bi still I am strugging for pulling the data.
Please provide sanitized sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.
I updated it with excel file in my post
First step: unpivot. Note that your first two columns are missing a column name so I excluded them
let
Source = Excel.Workbook(File.Contents("C:\Users\me\Downloads\excel.xlsx"), null, false),
#"Projektprognos _sheet" = Source{[Item="Projektprognos ",Kind="Sheet"]}[Data],
#"Removed Top Rows" = Table.Skip(#"Projektprognos _sheet", 1),
#"Removed Columns" = Table.RemoveColumns(#"Removed Top Rows",{"Column1", "Column2", "Column18"}),
#"Promoted Headers" = Table.PromoteHeaders(#"Removed Columns", [PromoteAllScalars=true]),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Promoted Headers", {"Typ", "Period"}, "Attribute", "Value"),
#"Changed Type" = Table.TransformColumnTypes(#"Unpivoted Other Columns",{{"Value", Currency.Type}, {"Attribute", Int64.Type}, {"Period", type date}})
in
#"Changed Type"
Now you can create your measures, one against Attribute 0 and the other against all other attributes.
Hello I already created unpivoted before. The only problem with the second measure I am getting. I am getting the wrong data. I created measure1 for the 0th attribute.
Measure1 = CALCULATE(sum('Projektprognos (2)'[Value]),'Projektprognos (2)'[Attribute]=0)
Measure2 = CALCULATE(sum('Projektprognos (2)'[Value]),'Projektprognos (2)'[Attribute]>0)
Thank you for the suggestion however measure2 I tried the same method however I cannot get these values in highlighted
Please state your calculation rules again. I am not clear which rule should be applied for attribute 0 versus the other ones.
I want pull always the data for 2022/05/23/(always from present date) the green highllighted from attribute 1 to 12. 2nd measure
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 |
---|---|
109 | |
102 | |
84 | |
79 | |
68 |
User | Count |
---|---|
120 | |
110 | |
94 | |
81 | |
77 |