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
Vijay08V
Helper II
Helper II

Need help with DAX measure

Hi all,

 

I need some help with DAX measure. Any help is high appreciated

 

Problem statement : To find the average score of each element based on the latest Id for each distinct location and show it in bar graph for different elements

 

Example :

For Digital element Id 73 and 74 are the latest one for US and CA respectively. Then my calculation for average score for digitial element would be

(3+4)/2 = 3.5 --- Numerator is 2 because of two different distinct locations

 

For Engagement element Id 73 and 77 are the latest one for US and CA respectively. Now my average score for engagement element would be

(3+3)/2 = 3

 

ElementScoreIdlocation
Digital373US
Digital474CA
Engagement373US
Engagement377CA
Engagement474CA
1 ACCEPTED SOLUTION

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

8 REPLIES 8
Vijay08V
Helper II
Helper II

@ChristianDGreat - The latest record will be determined by Id number. If you see for US location for engagement element Id 73 is the latest record and for CA location we have two records with ID 74 and 77 but record with ID 77 will be the latest one

Ashish_Mathur
Super User
Super User

Hi,

For determining the latest record, there should be a Date column as well.  Why have you not shown that?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur  - The latest record will be determined by Id number 

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur - Hi Ashish. Thanks its working!! Just one doubt here. Do I need to create a separate Id table ?? because I was able to get the required output from the main table Id column itself 

Hi,

As a good practise, I always do so.  Helps in relating multiple Fact Tables to this Dim Table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur  - Hi Ashish - I couldn't find any Pbi file in the attchement. It shows as Zipped file when I download. Could you pls reupload it as Pbix file

ChristianDGreat
Resolver I
Resolver I

On Engagement how do you know 77 and 73 are the latest one?

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.