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.
Hi everyone,
I have a dataset that looks a bit like this
For Deal Size Min and Max, it is in the dataset itself which is an excel sheet. The Average deal size is a measure that I have created. This is the DAX i wrote to get the Average Deal Size.
Average Deal Size test = CALCULATE(AVERAGE('PE Direct DP Form'[Deal Size (Max)]) + AVERAGE('PE Direct DP Form'[Deal Size (Min)]))/2
As you can see from the above picture, the total average is taking into account those where the average deal size is 0. This then skews the average. Is there a way to modify this measure to not take instances where the average deal size is 0 or blank?
Thanks
Solved! Go to Solution.
Hi @rjsidek ,
The purpose we use maxdate because we want to get the latest record for the company, we should add both date and company name into the filter, could you please try to use the following measure?
Average Deal Size test =
VAR latestd =
CALCULATE (
MAX ( Table1[Date of Event] ),
FILTER ( Table1, Table1[Deal Size (Max)] <> 0 && Table1[Deal Size (Min)] <> 0 )
)
VAR cname =
CALCULATE ( MAX ( Table1[Company Name] ), Table1[Date of Event] = latestd )
RETURN
CALCULATE (
DIVIDE (
CALCULATE (
AVERAGE ( Table1[Deal Size (Max)] ),
Table1[Deal Size (Max)] + 0 <> 0
)
+ CALCULATE (
AVERAGE ( Table1[Deal Size (Min)] ),
Table1[Deal Size (Min)] + 0 <> 0
),
2
),
'Table1'[Company Name] = cname && 'Table1'[[Date of Event] = latestd
)
Best regards,
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |