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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.