Power BI: calculate unique values
To exclude duplicates in my calculation, either for an average, a sum or a count:
I will use this formula to calculate by category:
SUMX(FILTER(SUMMARIZE('table','table'[argument1],'table'[argument2]),EARLIER('table'[argument1])='table'
[argument1]),[argument2])

NOTE:
- Change table and argument by yours
- To average, replace SUMX by AVERAGEX
- To count, replace SUMX by COUNTX
To sum the highest value by category:
SUMX(FILTER(SUMMARIZE('table','table'[argument1],'table'[argument2],"new value",MAX('table'[argument3])),EARLIER('table'[argument1])='table'[argument1]),[new value])
NOTE:
- Change new value by yours
- For the lowest value, change MAX by MIN
- If I want only for ticket, I will remove problem

To sum the value based on the first date by category:
SUMX(FILTER(SUMMARIZE('table','table'[argument1],'table'[argument2],"new value",CALCULATE(MAX('table'[argument3]),'table'[argument4]=MIN('table'[argument4]))),EARLIER('table'
[argument1])='table'[argument1]),[new value])
NOTE: for the last date, change MIN by MAX
For the full table:
SUMX(FILTER(SUMMARIZE('table','table'[argument1],'table'[argument2]),'table'[argument1]='table'[argument1]),[argument2])
NOTE: to use in a measure, replace EARLIER by MIN or MAX
Interesting Topics
-
Be successfully certified ITIL 4 Managing Professional
Study, study and study, I couldn’t be successfully certified without studying it, if you are interested...
-
Be successfully certified ITIL 4 Strategic Leader
With my ITIL 4 Managing Professional certification (ITIL MP) in the pocket, it was time to go for the...
-
Hide visual and change background color based on selection
Some small tricks to customize the background colour of a text box...
-
Stacked and clustered column chart or double stacked column chart
In excel, I use a lot the combination of clustered and stacked chart...
-
Refresh Power BI
From the Power BI Service, I can set refresh but, for instance, there is no option to do it monthly or each time a change is made...
-
Power BI alerts to be sent by email from an excel file based on condition
I will explain how to send a list of emails from an excel file after creating alerts...






