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
nitinbalodi
Helper I
Helper I

DAX - Calculated measure- help required

Hello all,

 

I am trying to create a measure where I should get the average of tickets created / total headcount for each city (I am able to do that).

 

Issue comes up when all cities are selected from slicer and it shows me the total of all cities, instead of overall average.  I have shared a Power BI file with sample data and required output is mentioned at the bottom of file.

 

Sample Power BI file is available at below location: 

Sample Power BI file 

 

Do let me know, if more clairty is required.

2 REPLIES 2
kennykhor
Frequent Visitor

The model wasn't accurately defined. Data and Headcount shall be linked by both City and Month

 

Necessary update of formulas as below:

  1. Ticket per HC = COUNT(Data[Ref No.]) / SUM(Headcount[Headcount])
  2. KeyCityMonth = [City] & "-" & FORMAT([Month],"YYYYMM")

Snipaste_2022-05-11_14-48-46.JPG

 

Snipaste_2022-05-11_14-55-22.JPG

 

jaipal
Resolver III
Resolver III

@nitinbalodi  hi create a new measure and add that measure to that measure to the cards where you wanted to display

 

Average 5 cities = Data[Ticket per HC] /5      (reason to use 5 is you have 5 cities in your data)
 
jaipal_1-1652250122530.png

 

 

 

If you wan to make it Dynamic, create Measures as follows

Cities count = DISTINCTCOUNT(Data[City])
Average for all cities = Data[Ticket per HC] / [Cities count]
 
and then add "Average for all cities"  to the cards where you wanted to display

 

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.