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
Dmalx
Frequent Visitor

Top N in related tables

I am not able to filter Top N in 2 related tables. I have to filter the latest value

So for a test I created a very simple table, the function works just fine:

F1.jpg

Then I have 2 related tables: 'DATE'[Id],[DateTime], another table [DateId]...Values... . So there is a relationship one to many DATE[Id]->[DateId]

F2.jpg

In the screenshot DateTime column is from table DATE the rest is from another table. I try to get the latest value "Wavelength" (79 from 8th April ). Obviously the Top N filter doesnt work.

How to fix the issue?

 

 
3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

@Dmalx 

It would be great if you can share your sample file. I believe the problem is because there is no direct relationship between Date time table and Dateid table.

 

Try remove DATE[Id]->[DateId] relationship, and create a relationship between [DateId] table and data time table.

 

Paul Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

 

Thank you for the reply!

If I try to calculate rank in the new date table, f.e.

Table 3 = SELECTCOLUMNS('DATE', "DT", 'DATE'[DateTime], "DID", 'DATE'[Id])
Rank = RANKX('Table 3', 'Table 3'[DT].[Date])
The issue is till be there:
F3.jpg

If I try to create the rank DateTime in new table

Column = RANKX('DATE', 'DATE'[DateTime])

I get the error:

A single value for column 'DateTime' in table 'DATE' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

 

Thank you

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.