Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
SantoshKumar
Employee
Employee

Create a measure to show AverageX value of two field even we select any one field in the Slicer

Hi All,

I have created a Measure (Resource_Count) which will do Group By and it is working as expected but i have a requirement for one specific filed (Area3) as follows.
When i select Area3 , irrespective of selected Region (Central or East), it should show the combined value as mentioned below.

 

Resource_Count = AVERAGEX(SUMMARIZE(SeqTable,SeqTable[TestedDay],
"CalMeasure",DISTINCTCOUNT(SeqTable[Resources])),[CalMeasure])
 

Sample data: 

AreaRegionRoleTestedDayResources
Area1EastDeveloper1Wenj
Area1CentralSupport2George
Area1PacificTester3Ross
Area1EastDeveloper4Suvarna
Area2CentralSupport1Mark
Area2PacificTester2Dev
Area2EastDeveloper3Mahi
Area3CentralSupport4George
Area3PacificTester1Suvarna
Area3EastDeveloper2Ross
Area3CentralSupport3Praj
Area3PacificTester4Tim
Area3EastDeveloper1Dev
Area3CentralTester2Mark

 

SantoshKumar_0-1671580451083.png

 

SantoshKumar_1-1671580604708.png

Regards
Santosh Kumar 

1 ACCEPTED SOLUTION

Hi , @SantoshKumar 

You can try to add some judgement in dax , like this:

Measure = var _special= CALCULATE( AVERAGEX(SUMMARIZE('Table','Table'[TestedDay],"CalMeasure",DISTINCTCOUNT('Table'[Resources])),[CalMeasure]) , ALL('Table'[Area]))
var _normal = AVERAGEX(SUMMARIZE('Table','Table'[TestedDay],"CalMeasure",DISTINCTCOUNT('Table'[Resources])),[CalMeasure])
return
IF(SELECTEDVALUE('Table'[Area])="Area3" && SELECTEDVALUE('Table'[Region]) in {"Central","East"} , _special , _normal)

Then we can only get the special data when we select Area3 , irrespective of selected Region.

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

3 REPLIES 3
v-yueyunzh-msft
Community Support
Community Support

Hi , @SantoshKumar 

According to your description, do you mean you want to show the total averagex in above?

If this , you can try to use this:

Measure = CALCULATE( AVERAGEX(SUMMARIZE('Table','Table'[TestedDay],"CalMeasure",DISTINCTCOUNT('Table'[Resources])),[CalMeasure]) , ALL('Table'[Area]))

The result is as follows:

vyueyunzhmsft_0-1671587300789.png

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

@v-yueyunzh-msft  No, your condition applies for entire set. i have ask for specific for Area3 only. such as 
When i select Area3 , irrespective of selected Region (only for Central or East), it should show the combined and for other selections it should as normal values only.

Hi , @SantoshKumar 

You can try to add some judgement in dax , like this:

Measure = var _special= CALCULATE( AVERAGEX(SUMMARIZE('Table','Table'[TestedDay],"CalMeasure",DISTINCTCOUNT('Table'[Resources])),[CalMeasure]) , ALL('Table'[Area]))
var _normal = AVERAGEX(SUMMARIZE('Table','Table'[TestedDay],"CalMeasure",DISTINCTCOUNT('Table'[Resources])),[CalMeasure])
return
IF(SELECTEDVALUE('Table'[Area])="Area3" && SELECTEDVALUE('Table'[Region]) in {"Central","East"} , _special , _normal)

Then we can only get the special data when we select Area3 , irrespective of selected Region.

 

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

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

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.