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
enthousiastnick
Frequent Visitor

Summery of unique values

Hi all,

I have a view based on 2 slicers:

enthousiastnick_0-1712820210109.png

 I need to calculate per site_nr (column 1 in view) the sum of b_overname_proc (= percentage column 4 in view) * sum of  aantal / dag (column 7 in view)
The result needs to be 8771 (6120+2345+306).

 

enthousiastnick_2-1712820545475.png

the result of this measure = 26.312 in stead of 8771 because it summerizes all the records.

Can someone please tell me what to do?

 Many, many thanks in advance, Nick

 

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

Hi @enthousiastnick 

 

Your problem is not using the correct arithmetic logic. Let's find the problem better by simplifying the code.

 

I have made the following changes to your dax, please try the modified code:

 

Here's some dummy data

 

“overname_spreiding_uur”

vnuocmsft_0-1712890448350.png

 

First, create a new table

 

 

Table = 
    SUMMARIZE(
        'overname_spreiding_uur',
        'overname_spreiding_uur'[b_overname_proc],
        "SumRecords",
        MAX('overname_spreiding_uur'[b_overname_proc]),
        "aantal/dag",
        MAX('overname_spreiding_uur'[aantal/dag])
    )

 

 

vnuocmsft_1-1712890524097.png

 

Create a measure in the original table.

 

 

Measure = SUMX('Table',('Table'[SumRecords] / 100) * 'Table'[aantal/dag])

 

 

Here is the result.

 

vnuocmsft_2-1712890607267.png

 

Regards,

Nono Chen

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-nuoc-msft
Community Support
Community Support

Hi @enthousiastnick 

 

Your problem is not using the correct arithmetic logic. Let's find the problem better by simplifying the code.

 

I have made the following changes to your dax, please try the modified code:

 

Here's some dummy data

 

“overname_spreiding_uur”

vnuocmsft_0-1712890448350.png

 

First, create a new table

 

 

Table = 
    SUMMARIZE(
        'overname_spreiding_uur',
        'overname_spreiding_uur'[b_overname_proc],
        "SumRecords",
        MAX('overname_spreiding_uur'[b_overname_proc]),
        "aantal/dag",
        MAX('overname_spreiding_uur'[aantal/dag])
    )

 

 

vnuocmsft_1-1712890524097.png

 

Create a measure in the original table.

 

 

Measure = SUMX('Table',('Table'[SumRecords] / 100) * 'Table'[aantal/dag])

 

 

Here is the result.

 

vnuocmsft_2-1712890607267.png

 

Regards,

Nono Chen

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

 

Thank you very much!
Yesterday, late in the afternoon I find out a solution myself, let me share this with you all; the reason why this is complex, is that the column hour is important,cause this my variate...

In this case the measure can be done in one time.

measure= SUMX (
   
    SUMMARIZE (
        'overname_spreiding_uur',
        'overname_spreiding_uur'[site], "Total",
        SUM('overname_spreiding_uur'[24h_impact]) / DISTINCTCOUNT(overname_spreiding_uur[uur])
    ),
    [TotalImpact]
)

 

 

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.