User Profile
AndreasMEG
Frequent Visitor
Joined 2 years ago
User Widgets
Contributions
Legend that shows all vs filterede name
Can someone help me showing all values, and one in legend at same time in Deneb? It works now like this methood, but i cant use that solution i report mode. Help me develop a filter that replace: !Turbine Filter = 'Query1'[TurbineName] IN {"Borre 4"}, so i can just pick one name instead of manually writing it. EX. Green is filtered value and the rest is same park Deneb Visual { "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "data": { "name": "dataset" }, "resolve": { "scale": { "color": "independent" } }, "transform": [ { "calculate": "toNumber(datum.Windspeed)", "as": "WindNum" }, { "calculate": "toNumber(datum.Production)", "as": "PowerNum" }, { "calculate": "toNumber(datum['Turbine Wind'])", "as": "TWNum" }, { "calculate": "toNumber(datum['Turbine Power'])", "as": "TPNum" } ], "layer": [ /* Baggrund: målepunkter */ { "transform": [ { "filter": "isValid(datum.PowerNum) && isFinite(datum.PowerNum)" }, { "filter": "isValid(datum.WindNum) && isFinite(datum.WindNum)" } ], "mark": { "type": "point", "filled": true, "size": 18, "opacity": 0.35 }, "encoding": { "x": { "field": "WindNum", "type": "quantitative", "title": "Vindhastighed (m/s)" }, "y": { "field": "PowerNum", "type": "quantitative", "title": "Effekt (kW)" }, "color": { "value": "#1f5ca8" }, "tooltip": [ { "field": "Model", "type": "nominal", "title": "Model" }, { "field": "WindNum", "type": "quantitative", "title": "Vind (m/s)" }, { "field": "PowerNum", "type": "quantitative", "title": "Effekt (kW)" } ] } }, /* Overlay: valgt turbine (hvis kolonnerne findes) */ { "transform": [ { "filter": "isValid(datum.TWNum) && isFinite(datum.TWNum)" }, { "filter": "isValid(datum.TPNum) && isFinite(datum.TPNum)" } ], "mark": { "type": "point", "filled": true, "size": 46, "stroke": "white", "strokeWidth": 0.8, "opacity": 0.95 }, "encoding": { "x": { "field": "TWNum", "type": "quantitative", "title": "Vindhastighed (m/s)" }, "y": { "field": "TPNum", "type": "quantitative", "title": "Effekt (kW)" }, "color": { "field": "Overlay", "type": "nominal", "legend": { "title": "", "orient": "top" }, "scale": { "range": ["#2ca02c"] } }, "tooltip": [ { "field": "Model", "type": "nominal", "title": "Model" }, { "field": "TWNum", "type": "quantitative", "title": "Vind (m/s)" }, { "field": "TPNum", "type": "quantitative", "title": "Effekt (kW)" } ] } }, /* Kurve: fra WindBinIndex/5 og Curve_kW (mean pr. vind & model) */ { "transform": [ { "filter": "isValid(datum.Curve_kW)" }, { "calculate": "toNumber(datum.WindBinIndex)/5", "as": "WindCurve" }, { "aggregate": [ { "op": "mean", "field": "Curve_kW", "as": "CurveMean" } ], "groupby": ["WindCurve", "Model"] } ], "mark": { "type": "line", "interpolate": "monotone", "strokeWidth": 2, "opacity": 0.95, "color": "#d62728" }, "encoding": { "x": { "field": "WindCurve", "type": "quantitative", "title": "Vindhastighed (m/s)" }, "y": { "field": "CurveMean", "type": "quantitative", "title": "Teknisk kurve (kW)" }, "order": { "field": "WindCurve", "type": "quantitative" }, "detail": [{ "field": "Model" }], "tooltip": [ { "field": "Model", "type": "nominal", "title": "Model" }, { "field": "WindCurve", "type": "quantitative", "title": "Vind (m/s)" }, { "field": "CurveMean", "type": "quantitative", "title": "Kurve (kW)" } ] } }, /* Usynligt lag som kun leverer Model-legend (valgfrit) */ { "mark": { "type": "point", "opacity": 0, "size": 1 }, "encoding": { "color": { "field": "Model", "type": "nominal", "title": "Model", "legend": { "orient": "right" } } } } ] } Values: Production Windspeed WindBinIndex Curve_kW Model Turbine Wind Turbine Power !Turbine Filter = 'Query1'[TurbineName] IN {"Borre 4"} Turbine Power = IF ( [!Turbine Filter], 'Query1'[Production], BLANK() ) Turbine Wind = IF ( [!Turbine Filter], 'Query1'[Windspeed], BLANK() )Solved587Views0likes4CommentsRe: Sort data over period and count - Multi Row Card
Table Data_ ID Date IBN Availability 5016 01-01-2023 01-02-2014 100% 5017 01-01-2023 01-04-2010 95% 5018 01-01-2023 01-09-2000 82% 5019 01-01-2023 01-07-1995 100% 5016 01-02-2023 01-02-2014 5% 5017 01-02-2023 01-04-2010 33% 5018 01-02-2023 01-09-2000 95% 5019 01-02-2023 01-07-1995 100% Dax Interval Interval Average Availability 95-100% 1 85-95% 1 65-85% 0 40-65% 2 20-40% 0 0-20% 0 Dax age (Ex. 01/01-1985 - 31/12/1989) Age Average Availability 1985-1990 1990-1995 1995-2000 100% 2000-2005 89% 2005-2010 2010-2015 58% 2015-2020871Views0likes0CommentsSort data over period and count - Multi Row Card
I wish to sort and count the data as below. I have Availability data from 01-01-2023 - 01-02-2024 and wish to know the average and sort it as shown in the left MultirowCard. I also wish to know the average Availability for the period sorted by age. (Right - MultirowCard)Solved1KViews0likes4CommentsRe: Countifs
Makes sence, perfect! Thank you so much! 😄 I changed the code a tiny bit (mRID - to text.type) let Source = MyData, ChangedType = Table.TransformColumnTypes(Source,{{"Date", type date}, {"Budget", Currency.Type}, {"mRID", Text.Type}}, "sk-SK"), GroupedRows = Table.Group(ChangedType, {"Date", "mRID"}, {{"Count", each Table.RowCount(_), Int64.Type}, {"All", each _, type table}}), ExpandedAll = Table.ExpandTableColumn(GroupedRows, "All", {"Budget"}, {"Budget"}) in ExpandedAll1.5KViews0likes1CommentRe: Countifs
I dont understand step 4, the code pasted is from step 3.) let Source = Json.Document(Web.Contents("https://rest.datapoint.dk")), #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error), #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"GSRN", "ProductionMeterPoint", "ConsumptionMeterPoint", "TurbineID", "TurbineName", "LegalOwner", "PortFolio", "CapacityMW", "BalanceResponsible", "DWI", "Ownership_Percent", "PriceCode", "FacilityAddress", "AcquisitionDate", "MA_Deal", "Land", "LeaseDKK", "LeasePercent", "LeaseRenewalYear"}, {"GSRN", "ProductionMeterPoint", "ConsumptionMeterPoint", "TurbineID", "TurbineName", "LegalOwner", "PortFolio", "CapacityMW", "BalanceResponsible", "DWI", "Ownership_Percent", "PriceCode", "FacilityAddress", "AcquisitionDate", "MA_Deal", "Land", "LeaseDKK", "LeasePercent", "LeaseRenewalYear"}), #"Changed Type" = Table.TransformColumnTypes(#"Expanded Column1",{{"GSRN", type text}, {"ProductionMeterPoint", type text}, {"ConsumptionMeterPoint", type text}, {"TurbineID", Int64.Type}, {"TurbineName", type text}, {"LegalOwner", type text}, {"PortFolio", type text}, {"CapacityMW", type number}, {"BalanceResponsible", type text}, {"DWI", Int64.Type}, {"Ownership_Percent", Int64.Type}, {"PriceCode", type text}, {"FacilityAddress", type text}, {"AcquisitionDate", type datetimezone}, {"MA_Deal", type text}, {"Land", type text}, {"LeaseDKK", type text}, {"LeasePercent", Percentage.Type}, {"LeaseRenewalYear", type text}}), #"Replaced Errors" = Table.ReplaceErrorValues(#"Changed Type", {{"ProductionMeterPoint", null}}), #"Replaced Errors1" = Table.ReplaceErrorValues(#"Replaced Errors", {{"TurbineID", null}}), #"Merged Queries" = Table.NestedJoin(#"Replaced Errors1", {"ProductionMeterPoint"}, Afregnet, {"mRID"}, "Afregnet", JoinKind.LeftOuter), #"Expanded Afregnet" = Table.ExpandTableColumn(#"Merged Queries", "Afregnet", {"Date", "Afregnet produktion"}, {"Afregnet.Date", "Afregnet.Afregnet produktion"}), #"Renamed Columns" = Table.RenameColumns(#"Expanded Afregnet",{{"Afregnet.Date", "Date"}, {"Afregnet.Afregnet produktion", "Afregnet produktion"}}) in #"Renamed Columns"1.5KViews0likes1Comment
Data Privacy
Microsoft Fabric Community and Privacy
To learn more about how we manage your data, please review the Microsoft Fabric Community Data Privacy guide.