Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello Team,
I need help with dax to get Average however I got it for count(Dax).
I need dax for average for below
average_Lmonth = Last Nmonth -1(Jan-24, Feb-24, Mar-24, Apr-24).
average = Lmonth(Jan-24, Feb-24, Mar-24, Apr-24,May-24)
Folder: Sample File
Regards,
Chandrashekar B
Solved! Go to Solution.
Thanks for the reply from @BeaBF . The following is my testing for your reference.
I added some data in the table.
Measure =
VAR _Last1month =
CALCULATE (
COUNT ( 'Table'[Company] ),
FILTER (
'Table',
[Month_Year] >= MIN ( slicer[Month_Year] )
&& [Month_Year]
<= DATE ( YEAR ( MAX ( slicer[Month_Year] ) ), ( MONTH ( MAX ( slicer[Month_Year] ) ) - 1 ), DAY ( MAX ( slicer[Month_Year] ) ) )
)
)
VAR _lastmonth =
CALCULATE (
COUNT ( 'Table'[Company] ),
FILTER (
'Table',
[Month_Year] >= MIN ( slicer[Month_Year] )
&& [Month_Year] <= MAX ( slicer[Month_Year] )
)
)
RETURN
DIVIDE ( _Last1month, _lastmonth )
Output:
Due to Security Policy, I am unable to open your link. If there is still a problem, please let me know the logic for calculating your desired result.
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Chandrashekar Hi! Try with:
Hello,
Sorry not getting expected output. Expected out as below. Thanks in advance.
Output:
Input:
Regadrds,
Chandrashekar B
@Chandrashekar Try:
Hello,
Month should be dynamic.
Regards,
Chandrashekar B
Hello,
Depends on selection from slicer. it may be old data(May be 2018 to till today.
Final Intention is to check how client is doing.
Regards,
Chandrashekar B
Regards,
Chandrashekar B
Hello,
Can we take average based on company instead of sl no.
Regards,
Chandrashekar B
Thanks for the reply from @BeaBF . The following is my testing for your reference.
I added some data in the table.
Measure =
VAR _Last1month =
CALCULATE (
COUNT ( 'Table'[Company] ),
FILTER (
'Table',
[Month_Year] >= MIN ( slicer[Month_Year] )
&& [Month_Year]
<= DATE ( YEAR ( MAX ( slicer[Month_Year] ) ), ( MONTH ( MAX ( slicer[Month_Year] ) ) - 1 ), DAY ( MAX ( slicer[Month_Year] ) ) )
)
)
VAR _lastmonth =
CALCULATE (
COUNT ( 'Table'[Company] ),
FILTER (
'Table',
[Month_Year] >= MIN ( slicer[Month_Year] )
&& [Month_Year] <= MAX ( slicer[Month_Year] )
)
)
RETURN
DIVIDE ( _Last1month, _lastmonth )
Output:
Due to Security Policy, I am unable to open your link. If there is still a problem, please let me know the logic for calculating your desired result.
Best Regards,
Yulia Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello,
Thank you and will check.
Regards,
Chandrashekar B
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
13 | |
11 | |
8 |