Forum Discussion
Average selected month
hi, can someone assist me
i would like to display average before and after in power bi
Hi, powerbi1986
You could create measures like the following:average after =
AVERAGEX(
FILTER(
ALLSELECTED( 'table' ),
'table'[month] > SELECTEDVALUE( 'table'[month] )
),
[value]
)average before =
AVERAGEX(
FILTER(
ALLSELECTED( 'table' ),
'table'[month] <= SELECTEDVALUE( 'table'[month] )
),
[value]
)Or, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.
Best Regards,
Community Support Team _ Zeon ZhengIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- parry2kSuper User
powerbi1986 Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490 - Pragati11Super User
Hi powerbi1986 ,
Not sure what you mean by Average before and after here.
Add more details.
Thanks,
Pragati
- powerbi1986Frequent Visitor
sorry..
if the selected month = jun
average before = average from jan to jun
average after = average from july to decif the selected month = july
average before = average from jan to july
average after = average from aug to dec
- v-angzheng-msftCommunity Support
Hi, powerbi1986
You could create measures like the following:average after =
AVERAGEX(
FILTER(
ALLSELECTED( 'table' ),
'table'[month] > SELECTEDVALUE( 'table'[month] )
),
[value]
)average before =
AVERAGEX(
FILTER(
ALLSELECTED( 'table' ),
'table'[month] <= SELECTEDVALUE( 'table'[month] )
),
[value]
)Or, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.
Best Regards,
Community Support Team _ Zeon ZhengIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.