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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
BillR
Frequent Visitor

new user question

New, as in today.  I'm trying to teach myself this, and for my first project I've brought in 2 tables and related them correctly.  One is a table of attempts with user and location, and the other keeps track of reasons for failure.  I want a measure that has success percentage like 1-(count(failures)/count(attempts)) and be able to drop the location or user on the chart. So, do I build measures for the 2 counts, and then do the math in another measure? In which table should the measures reside?  I'm not getting the concepts yet. Thanks in advance.

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @BillR,

 

>>So, do I build measures for the 2 counts, and then do the math in another measure?

You can direct count them in the same formula.(measures will affect the performance)

 

>>In which table should the measures reside?

For my opinion, I will to put the measure at the side of part calculation

 

In addition, you can also take a look to below sample if it suitable for your requirement:

 

1. Tables.

attempts: GUID, UserID, Location (guid is unique id of each records)

failure records: GUID, Reasons (guid is from attempts table)

 

2. Relationship: GUID to GUID  "one to many" relationship with "both" cross filter direction.

 

3. Measure formulas:

Percent = DIVIDE(COUNT('failure records'[GUID]),COUNT(attempts[GUID]))

Success Rate = 1-[Percent]

 

 

 

4. Create table visual.

Capture.PNG

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @BillR,

 

>>So, do I build measures for the 2 counts, and then do the math in another measure?

You can direct count them in the same formula.(measures will affect the performance)

 

>>In which table should the measures reside?

For my opinion, I will to put the measure at the side of part calculation

 

In addition, you can also take a look to below sample if it suitable for your requirement:

 

1. Tables.

attempts: GUID, UserID, Location (guid is unique id of each records)

failure records: GUID, Reasons (guid is from attempts table)

 

2. Relationship: GUID to GUID  "one to many" relationship with "both" cross filter direction.

 

3. Measure formulas:

Percent = DIVIDE(COUNT('failure records'[GUID]),COUNT(attempts[GUID]))

Success Rate = 1-[Percent]

 

 

 

4. Create table visual.

Capture.PNG

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

I would certainly recommend doing it the way you have suggested.  From a programming background i'm a big believer in doing things in modular ways, especially when you might want to use those results in other places.

 

Something you will eventually trip over, there are some Dax expressions that won't accept measures as a parameter.  In those occasions you have to take your measure's code, and place it within that expression instead.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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