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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
dinosainsburys
Frequent Visitor

How do I remove duplicate values within a specific category of rows

I ingest data from the Dynatrace API in relation to the drive utilisation of servers. In order to get it to a readable state, I had to Unpivot columns as it was presented like this when it came through:

 

ComputerRESULTS.DATE.0RESULTS.DATE.1RESULTS.DATE.2xxxxxRESULTS.VALUE.0RESULTS.VALUE.1xxx
COMP-457312/12/202313/12/202314/12/2023xxxx546385699

xxxx

xxxxxxxxxxxxxxxxxxxxxxxxxx

xxxx

 

 

The RESULTS.DATE (they were in EPOCH Time but did some transformations to get it to a friendly date) columns would repeat for at least 30 times and so would the RESULTS.VALUE column. They both were Unpivoted to combine the two categories together. So now the Date and Results column are in one belonging to their respective category. 

 

The issue I am having is that there is a lot of duplicate dates for the same 'Computer' but the Results column is different too. So it looks like this

 

ComputerRESULTS.DATERESULTS.VALUE
COMP-457312/12/202358.1
COMP-457312/12/202358.12
COMP-457312/12/202358.5
COMP-457312/12/202357.8
COMP-457313/12/202360
COMP-457313/12/202361.2
COMP-457313/12/202361.2
xxxxxxxx61.3

 

If I put the visualisation as a table, it is appararent the results value is different and there is variation

Is there a sort of measure or DAX expression which collates the date as one value with the results value? Or to only take in one value from the date column?

1 ACCEPTED SOLUTION

Hi @dinosainsburys ,
According to your description, in order to make the final generated data more meaningful, you can try to use the average value, maximum value(Max), minimum value(Min) as a measure for a certain day, and you can do this by modifying the parameter referenced after "Total Value". Here is an example of an average value

Total Value by Date = 
CALCULATETABLE(
    ADDCOLUMNS(
        DISTINCT('Table'[RESULTS.DATE]),
        "Computer",MAX('Table'[Computer]),
        "Total Value", CALCULATE(AVERAGE('Table'[RESULTS.VALUE]),ALLEXCEPT('Table','Table'[RESULTS.DATE]))
    ),
    'Table'[RESULTS.DATE] = 'Table'[RESULTS.DATE]
)

 

vheqmsft_0-1711500705379.png

 

Best regards,

Albert He

 

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

4 REPLIES 4
v-heq-msft
Community Support
Community Support

Hi @dinosainsburys ,
Thanks to @AUDISU @ for the solution. Next is what I need to add:
First you can manipulate the data by using matrix visual objects:

vheqmsft_0-1711433247514.png

Secondly you can create a new column above the original table to merge the two columns.

Column = CONCATENATE(FORMAT('Table'[RESULTS.DATE],"dd-mm-yyyy"),FORMAT('Table'[RESULTS.VALUE],"+00.00"))

 

vheqmsft_1-1711433318902.png

Finally you can also create a new table via dax

Total Value by Date = 
CALCULATETABLE(
    ADDCOLUMNS(
        DISTINCT('Table'[RESULTS.DATE]),
        "Computer",MAX('Table'[Computer]),
        "Total Value", CALCULATE(SUM('Table'[RESULTS.VALUE]),ALLEXCEPT('Table','Table'[RESULTS.DATE]))
    ),
    'Table'[RESULTS.DATE] = 'Table'[RESULTS.DATE]
)

 

vheqmsft_2-1711433363469.png

Best regards,

Albert He

 

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

Hi, this seems almost correct, but this is in relation to drive utilisation of a server drive. So anything above 100 wouldn't make sense. Any way this could be modified, please?

 

Thanks for the help so far! 🙂

Hi @dinosainsburys ,
According to your description, in order to make the final generated data more meaningful, you can try to use the average value, maximum value(Max), minimum value(Min) as a measure for a certain day, and you can do this by modifying the parameter referenced after "Total Value". Here is an example of an average value

Total Value by Date = 
CALCULATETABLE(
    ADDCOLUMNS(
        DISTINCT('Table'[RESULTS.DATE]),
        "Computer",MAX('Table'[Computer]),
        "Total Value", CALCULATE(AVERAGE('Table'[RESULTS.VALUE]),ALLEXCEPT('Table','Table'[RESULTS.DATE]))
    ),
    'Table'[RESULTS.DATE] = 'Table'[RESULTS.DATE]
)

 

vheqmsft_0-1711500705379.png

 

Best regards,

Albert He

 

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

AUDISU
Resolver III
Resolver III

Hi @dinosainsburys ,
Create a calender table and create relationship between calender table and this table. Then use calender date column to visual.
If not try to change aggrigation type to First in Result.Date column in your visual table.

AUDISU_0-1711393611574.png
Thanks

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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