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

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.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.