Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
nix
Frequent Visitor

DAX CALCULATION

 

nix_0-1728967767824.png
I am using this calculated column for column 3,actually it should calculate minimum nad date from nad_custome_date for vessel_id wise(i have selected only one vessel here),then it should calculate minimum of 

[startofsailingpassage] per vessel,then  it should compare with minimum nad date,if true then 1 or else 0,so true should come once only rest should false but it is countung for each port wise ,
how to solve this

TIA
1 ACCEPTED SOLUTION
v-jiewu-msft
Community Support
Community Support

Hi @nix ,

Based on the testing, please try the following methods:

1.Create the sample table.

vjiewumsft_0-1729223265065.png

2.Create the new column to filter the date.

Column 3 = 
VAR _MIN_VESAEL = CALCULATE(MIN('Missing Arrival/Depart query'[nad_customer_date]), ALLEXCEPT('Missing Arrival/Depart query', 'Missing Arrival/Depart query'[vessel_id]))
VAR _startofpassage = CALCULATE(MIN('Missing Arrival/Depart query'[startofpassage]), ALLEXCEPT('Missing Arrival/Depart query', 'Missing Arrival/Depart query'[vessel_id]))
RETURN
IF('Missing Arrival/Depart query'[nad_customer_date] = _MIN_VESAEL && _MIN_VESAEL = _startofpassage && 'Missing Arrival/Depart query'[nad_type] = 59, 1, 0)

3.The result is shown below.

vjiewumsft_1-1729223285417.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-jiewu-msft
Community Support
Community Support

Hi @nix ,

Based on the testing, please try the following methods:

1.Create the sample table.

vjiewumsft_0-1729223265065.png

2.Create the new column to filter the date.

Column 3 = 
VAR _MIN_VESAEL = CALCULATE(MIN('Missing Arrival/Depart query'[nad_customer_date]), ALLEXCEPT('Missing Arrival/Depart query', 'Missing Arrival/Depart query'[vessel_id]))
VAR _startofpassage = CALCULATE(MIN('Missing Arrival/Depart query'[startofpassage]), ALLEXCEPT('Missing Arrival/Depart query', 'Missing Arrival/Depart query'[vessel_id]))
RETURN
IF('Missing Arrival/Depart query'[nad_customer_date] = _MIN_VESAEL && _MIN_VESAEL = _startofpassage && 'Missing Arrival/Depart query'[nad_type] = 59, 1, 0)

3.The result is shown below.

vjiewumsft_1-1729223285417.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

ryan_mayu
Super User
Super User

could you pls provide some sample data (not the screenshot) and the expected output?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.