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

First sale type from list of sales

I have three tables in my Dataset

 

Dates (Calendar)

Templates (Customer Records)

Gifts(Sales)

 

I have created a calculated column in the Templates table to pick up the first gift type, based on the gift date.  It is returning the same result for every record.  There should be two different results in a ratio of approx 1:9.  The result being returned is the lower count.

 

The column I am using is:
First Gift Type = maxx(
                            topn(1,
                                  summarize('Gifts',Dates[Date],'Gifts'[Gift Type]),
                                 Calculate(min(Dates[Date])),asc),
                                     'Gifts'[Gift Type] )

 

 

Relationships are as follows.

Relationships.PNG

 

 

 

 

 

 

 

 

 

 

Thanks for any help 

4 REPLIES 4
anandav
Skilled Sharer
Skilled Sharer

@ozpeacenik,

 

You need to explain your problem with some sample data for the tables and expected results.

Check whether the below artcile could help:

https://whatthetechisthat.wordpress.com/2018/04/09/selecting-the-first-record-with-same-values-in-an...

 

Sample Data.PNG

First Gift Type is showing what I want to see, but I am getting the same result for every row in my dataset.

@ozpeacenik,

Try creating a new table from your First Gift type table using Summarize function.

Thanks Anandav, I will give that a try.

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.