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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
teresating886
Frequent Visitor

DAX measure value not repeated in a table cell if it's already shown in the previous row

Hi, The DAX measure I want to improve is tractor count. It counts distinct tractor numbers.

 

Tractor # = CALCULATE(DISTINCTCOUNT('Table'[ivh_tractor]), GROUPBY('Table','Table'[ivh_driver]))

 

What I want to achieve is that the "1"s highlighted in the table should be blank because they have been countetd in the previous rows. Here is the sample dataset. Thank you for your input.

 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("jdTbjsIgEAbgd/HaRIYzl7QlS5WKwVM2xvd/jW02BdRJW+9M/NLM/PzweGzEju4ooXSz3TQxdPY4/lCgOYCgdvwNCsDozXP7TpNrYjNRzpScKCNyhRpYoNfUekvYhJlQZMIcxCce5d5ZAnUIPWHxBTZiAcfYxWv9LiuUIXpNB3d8+a7geWKGQsNYzOPO3s7e1XnVRKUCTO8u3HJoCsq5KbTaO9VltTU61sHMU9fdW5/KqfE8KwW01kiT+ylr6XxmkqNsP6hh89TbcEm1OGMI/yMoxfn4/xrWcgH3YW8HoBWX4lDUXx/TxcdywEzIHJrELfvEhsA8Dr+x6UMegtPcMilQG4Y2HNztpWUMpvUYDm5ojwcf63LlcoJZo3SB9sGlvq6mWU6YGJTwyaY2JkJLaFxPGIAg7O3Q5yeKqRqZRE1LtkvxWOdV5RbzFWro91Qu0NidbH5GmNS1C4ieL/bsX54nSkRJdxUzo+fxWLHBJiLKGCY/qVQjfO9Dig1R9RqRcufQuSFs+Ct+/gE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [delivery_date = _t, ivh_driver = _t, ivh_invoicenumber = _t, ivh_tractor = _t])
in
    Source

 

 

 

 

 

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @teresating886 ,

 

Try this.

Tractor # = 
COUNTROWS(
    FILTER(
        'Table',
        'Table'[ivh_invoicenumber]=CALCULATE(MIN('Table'[ivh_invoicenumber]),ALLEXCEPT('Table','Table'[ivh_driver]))
    )
)

vcgaomsft_0-1654054042323.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

2 REPLIES 2
v-cgao-msft
Community Support
Community Support

Hi @teresating886 ,

 

Try this.

Tractor # = 
COUNTROWS(
    FILTER(
        'Table',
        'Table'[ivh_invoicenumber]=CALCULATE(MIN('Table'[ivh_invoicenumber]),ALLEXCEPT('Table','Table'[ivh_driver]))
    )
)

vcgaomsft_0-1654054042323.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Arul
Super User
Super User

@teresating886 ,

 

Did you created any measure or is it a direct column that you are using in visual?

 

Thanks,

Arul





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

Proud to be a Super User!


LinkedIn


Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.