User Profile
Fragmaticx
Frequent Visitor
Joined 1 year ago
User Widgets
Contributions
Re: CalculationGroups - switch between dates
Hi everybody, This is a small sample set. I have a calculation group: DateToUse Item 1: SELECTEDMEASURE () Item 2: CALCULATE ( SELECTEDMEASURE (), USERELATIONSHIP ( BaseData[ShipmentPeriod], 'DateTable'[Date] ) ) OperationalPeriod ShipmentPeriod AmountDKK Type Customer TransportType 01-08-2025 01-08-2025 100 2 Dennis 1 01-07-2025 01-08-2025 150 2 Dennis 1 Lastmile Cost - Different Period = CALCULATE( SUMX( BaseData, BaseData[AmountDKK] ), FILTER( BaseData, BaseData[Type] = 2 && BaseData[TransportType] = 1 && BaseData[ShipmentPeriod] <> BaseData[OperationalPeriod] ) ) I expect it to show if ShipmentPeriod is selected then it should be 0 since both lines are within that period, and if OperationalPeriod is selected it should show 150, since they are 01-07-2025. I appriciate your help,999Views0likes1CommentCalculationGroups - switch between dates
Hi I have a model where I use calculaton groups to switch between dates. Lets say its a Order Date and Delivery Date - and I want to make a calculation based of the 2 dates. I think i need something like, if selectedmeasure is OperationalDate then BaseData[ShipmentPeriod] <> BaseData[OperationalPeriod] elseif Selectedmeasure is ShipmentPeriod then BaseData[OperationalPeriod] <> BaseData[ShipmentPeriod] Lastmile Cost - Different Period = CALCULATE( SUMX(BaseData, BaseData[AmountDKK]), FILTER( BaseData, BaseData[Type] = 2 && BaseData[TransportType] = 1 && BaseData[ShipmentPeriod] <> BaseData[OperationalPeriod] ) ) but I dont know how to do it?Solved1.1KViews0likes7CommentsCalculate avg for the previous 3 month and apply
Hi I'm working on a model. And I want to calculate Average Cost Per Parcel (for the preivous 3 month), with data. And Apply that to Parcels Sales (EST) And it seems like it working, or atleast i calculate a avg. But it does not apply to the 2 most recent months: Market Lastmile Amount Cost Estimated Lastmile Cost Parcels Cost Parcels Sales (EST) Avg Cost Per Parcel (Last 3 Months) ShipPeriod PT 1.375.489 1.360.924 60.817 60.173 22,62 202408 PT 1.458.816 1.439.754 64.514 63.671 22,61 202409 PT 1.757.429 1.732.260 77.784 76.670 22,59 202410 PT 1.954.116 1.918.556 84.681 83.140 23,08 202411 PT 2.569.072 2.532.680 111.612 110.031 23,02 202412 PT 1.710.249 1.679.592 72.633 71.331 23,55 202501 PT 1.495.076 1.477.836 62.441 61.721 23,94 202502 PT 60.341 202503 PT 182 202504 Avg Cost Per Parcel (Last 3 Months) = VAR AvailableMonths = FILTER( VALUES('DateTable'[ShipPeriod]), NOT ISBLANK([Avg Cost Per Parcel]) && [Avg Cost Per Parcel] <> 0 ) VAR LastThreeMonthsWithData = TOPN(3, AvailableMonths, 'DateTable'[ShipPeriod], DESC) -- Get the latest 3 months with data VAR Result = CALCULATE( AVERAGEX(LastThreeMonthsWithData, [Avg Cost Per Parcel]), -- Average only non-blank months 'DateTable'[ShipPeriod] IN LastThreeMonthsWithData ) RETURN Result Most of this is done by chatgpt, since i'm not that good at dax. So if there is something obvious im missing, please help me 🙂 Thanks in advance,Solved1.1KViews0likes5CommentsWrite data directly to DWH from external application?
Hi I'm fairly new working with Fabric/DWH in general. We have some etl processes outside fabric - where we are able to provide a finished dataset. And I was hoping that I would write directly into a DWH table from my external app. And it does work, but when I look at the query from DWH it makes a query per row in my dataset, meaning i took me almost 2 hours to insert 8k rows. Is it not possible to do this directly? Using either oledb or bulk insert to DWH?Solved2.4KViews0likes6CommentsRe: Filter 2 dates in the same table, at once
Hi Bibiano_Geraldo I did what you suggested using this measure: IsInSelectedPeriod = VAR SelectedYearMonth = SELECTEDVALUE('DateTable'[ShipPeriod]) RETURN IF( CALCULATE( COUNTROWS('BaseData'), FILTER( 'BaseData', FORMAT('BaseData'[ShipmentDateSales], "YYYYMM") = SelectedYearMonth || FORMAT('BaseData'[ShipmentDateCost], "YYYYMM") = SelectedYearMonth ) ) > 0, 1, 0 ) If I join my date table on sales and filter october 24 i get a different amount than if i join the date table on my table and filter ostober using this logic. Did i miss something?1.6KViews1like1CommentFilter 2 dates in the same table, at once
Hi I have a flat table with ShipmentDateCost and ShipmentDateSales I want to find a way to filter on those 2 dates at once. So I want to see all bought and solgt in ex. september 2024? I tried adding 2 date tables, one for each field, and then a Year-Month table to filter those 2, but it does not work. ChatGPT said something like this: IsInSelectedMonth = VAR SelectedMonth = SELECTEDVALUE('DateTableCost'[Month]) VAR SelectedYear = SELECTEDVALUE('DateTableCost'[Year]) RETURN IF( CALCULATE( COUNTROWS('BaseData'), YEAR('BaseData'[ShipmentDateCost]) = SelectedYear && MONTH('BaseData'[ShipmentDateCost]) = SelectedMonth ) > 0 || CALCULATE( COUNTROWS('BaseData'), YEAR('BaseData'[ShipmentDateSales]) = SelectedYear && MONTH('BaseData'[ShipmentDateSales]) = SelectedMonth ) > 0, 1, 0 ) but i dont think its giving me the proper result. And ideas?Solved1.6KViews1like8Comments
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.