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

Ambiguous paths when linking to date table / How to count rows containing a particular value

So I have a dataset that contains a list of problems, some information about the problem, and a date the problem was submitted / fixed. I have a Measure calculating the difference between the fix date & the submit date, to determine how long the problem was in process, and assigning it a "bucket" value based on this calculation (<5 days, 5-10 days, 10+ days, etc). I also have a Date Table which has model link to the Submitted date.

 

Example Data:

Submitted DateFixed DateDays in FieldTime in Field
1/1/211/3/212<5 Days
2/1/212/7/2165-10 Days
3/1/213/4/213<5 Days
4/1/214/16/211510+ Days

 

I would like to create a count of problems within each "bucket" - which I was able to do using this code:

 

Bucket1 = calculate(COUNTX(filter('Table1','Table1'[Time in Field]="<5 Days"),'Table1'[Time in Field]))

 

This created a separate measure for each bucket and a tally of each instance. (If there is a better way to go about this, please let me know)

 

Then, I want chart the number of, say, <5 Day fixes that occured over time. I can do that if I use the Submitted Date directly from the dataset, but if I use the Date table instead it gives me the following error:

 

"Couldnt load the data for this visual. There are ambiguous paths between..."

 

Any ideas for a way to solve this?

1 ACCEPTED SOLUTION
CNENFRNL
Community Champion
Community Champion

Screenshot 2021-10-27 041148.png

Screenshot 2021-10-27 044640.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

6 REPLIES 6
CNENFRNL
Community Champion
Community Champion

Screenshot 2021-10-27 041148.png

Screenshot 2021-10-27 044640.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

This is next level!

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

Interesting! So the way that I set up the Time in Field calculation was like this:

 

Time in Field = 
SWITCH(
    TRUE(),
    MIN('NCR Raw DL'[DAYSINFIELD])<0, "Exclude",
    MIN('NCR Raw DL'[DAYSINFIELD]) <5, "<5 Day",
    MIN('NCR Raw DL'[DAYSINFIELD])<10, "5-10 Day",
    "10+ Day"
    )

 

I can try and set it up with a reference table like you have, though I'm not sure that would solve my inability to link it to the Date table? I'll give it a try.

EDIT TO ADD: It worked! I'm not really sure why, but it lets me link to the Date table now. I'll accept your solution, but if you feel up to it, I'd love a brief explanation if possible?

TheoC
Super User
Super User

Hi @swisdom 

 

Are you able to share a screenshot of your Model / Relationships view? It is very likely the error is stemming from established relationships.

 

Also, in terms of the grouping, you can use "Conditional Columns" in Power Query which reduces the volume of measures that you require and will achieve the same outcome.  Let me know if you'd like me to run you through simple steps for this 🙂

 

TheoC_0-1635290201423.png

 

 

Theo

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

I am actually not able to edit the dataset/columns in PowerQuery, as it is linked from an outside source via DirectQuery. This is why I am using Measures for all the calculations 🙂

swisdom_1-1635338635003.png

This is the portion of the model linking the data table in question to the Date table, with the active link highlighted. (The others are inactive links to other dates in the table for other calculations using [USERELATIONSHIP] later, though they are not set up yet.)

The Date table also links to the Shipping dataset just above it in the same way. There are also links to other reference tables (customer, failure type, location, etc) but nothing that is causing circular logic that I can see.

@swisdom thank you for sharing.  It's really interesting.  I am unsure to be honest. Although a clear solution has been provided to get you the outcome required, I am interested to better understand the cause of the error otherwise, as you expand / enhance your report, there is a potential likelihood that it may repeat itself if not identified / corrected.

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

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.