Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Dont know what am doing wrong. Dont get why visual not updating
First i set 2 parametrs start date and end date
Then i updated my query(this works correctly as i expect
the parameters work. i get the set of data i want from
startdate to end date
let
// Retrieve the managed parameters for StartDate and EndDate
StartDateParam = Date.From(StartDate),
EndDateParam = Date.From(EndDate),
// Convert StartDate and EndDate to text with the format 'yyyy-MM-dd'
StartDateText = Date.ToText(StartDateParam, "yyyy-MM-dd"),
EndDateText = Date.ToText(Date.AddDays(EndDateParam, 1), "yyyy-MM-dd"),
// Dynamic parameters for NodeId and EventName
NodeId = 71,
EventName = "Ambient conditions",
// Construct the SQL query string dynamically
QueryString = "SELECT TOP (10000) [RecordTime],[RecordDate], [Value], [VariableName] FROM [myv].[events] WHERE NodeId=" & Text.From(NodeId) &
" AND EventName='" & EventName & "'" &
" AND RecordDate >= '" & StartDateText & "'" &
" AND RecordDate < '" & EndDateText & "'" &
" ORDER BY RecordTime DESC",
// Connect to the database with the dynamic query string
Source = Sql.Database("myserver", "db", [CommandTimeout=#duration(0, 0, 1, 0), Query=QueryString]),
// Step: Group rows by RecordTime
GroupedRows = Table.Group(Source, {"RecordTime"}, {{"AllData", each _, type table [RecordTime=datetime, Value=nullable text, VariableName=nullable text]}}),
// Step: Expand AllData to include Value and VariableName, excluding RecordTime to avoid duplication
ExpandedAllData = Table.ExpandTableColumn(GroupedRows, "AllData", {"Value", "VariableName"}, {"Value", "VariableName"}),
// Step: Change the type of Value to number
ChangedType = Table.TransformColumnTypes(ExpandedAllData,{{"Value", type number}}),
// Step: Pivot the table based on VariableName
PivotedColumn = Table.Pivot(ChangedType, List.Distinct(ChangedType[VariableName]), "VariableName", "Value", List.First)
in
PivotedColumn
Then i have created both a StartDateTable and EndDateTable
I then bind the bot parameters
I then create slicer for both values
i have a chart but when i move the dates nothing happens i was expecting
data model (do i need to map relationships how would id do this?)
do i need to create a start date and an enddate for the Ambient conditions table table the join up with my start date and end date.
I was trying to follow this tutorial https://www.youtube.com/watch?v=pXU_SpiBWUA in this theres no relationships between and still works
Hi @muhammadpathan ,
Based on your description and the screenshot provided, it appears that you have created an initial and end date similar to the dimension table. However, you don't seem to have established a relationship between the table you want to create the visual object from and the dimension table i.e. record time and startdatetable, enddatetable. if there is no connection between them, then the resulting filter will not work on the visual object either. Of course, you can write dax expressions that use selectedvalue to call the values in the two slicers, which will also allow you to control the visual object without establishing a relationship.
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
User | Count |
---|---|
106 | |
86 | |
81 | |
73 | |
71 |
User | Count |
---|---|
112 | |
100 | |
98 | |
72 | |
66 |