The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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
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?
Hi @Fragmaticx , Hope you're doing okay! May we know if it worked for you, or are you still experiencing difficulties? Let us know — your feedback can really help others in the same situation.
Hi @Fragmaticx , hope you are doing great. May we know if your issue is solved or if you are still experiencing difficulties. Please share the details as it will help the community, especially others with similar issues.
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,
Hi @Fragmaticx please try this
Hi @Fragmaticx As i understand, you can try using ISSELECTEDMEASURE where you want change depending on measures shipment based, operational based
Please share sample datasets to test
I am unsure as to what you are trying to do
Please include, in a usable format, not an image, a small set of rows for each of the tables involved in your request and show the data model in a picture, so that we can import the tables in Power BI and reproduce the data model. The subset of rows you provide, even is just a subset of the original tables, must cover your issue or question completely. Do not include sensitive information and do not include anything that is unrelated to the issue or question. Please show the expected outcome based on the sample data you provided and make sure, in case you show a Power BI visual, to clarify the columns used in the grouping sections of the visual.
Need help uploading data? click here
Want faster answers? click here
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
20 | |
12 | |
10 | |
7 |