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
Kumshan450
Helper III
Helper III

DISTINCT TABLE USING DAX MEASURES

I have a file named receipt data with duplicates receipt no. Sample data

 

RECEIPT_NOBPIS_NOBPIS_VALUE_DATE
C0597141800083SBIN61812736153407-May-18
C04760418013813686790023-Apr-18
C04760418013793686790023-Apr-18
C04760418013813686790023-Apr-18
C04760418013793686790023-Apr-18

 

I know that we can remove duplicates using power query – simple step.

 

But I cannot perform the simple step due to the large data model.

 

I compared the query loading to data model with and without removing duplicates.

 

It takes hell lot of time when the data is loaded to power query after removing duplicates in power query.

 

Data loads faster if removing duplicates steps not performed in power query.

 

So after loading the receipt data containing duplicates in power pivot, I created a distinct table with unique receipt no.

 

RECEIPT_NO
C0597141800083
C0476041801381
C0476041801379

 

Now I don’t know how to get the additional columns of receipt data in the distinct table. I tried to do with related function but it does not work.

 

Output required. 

 

RECEIPT_NOBPIS_NOBPIS_VALUE_DATE
C0597141800083SBIN61812736153407-May-18
C04760418013813686790023-Apr-18
C04760418013793686790023-Apr-18
4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

 

If you only have 1 Table, you do not need to create a seperate receipts table.  In a Table visual, i simply dragged the Receipt_No field.  I then wrote these two measures

 

Date = MIN(Data[BPIS_VALUE_DATE])

BPIS Number = FIRSTNONBLANK(Data[BPIS_NO],1)

 

Hope this helps.

 

Untitled.png


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

In this case i have two table 

 

One table contains the collection data. This also contains duplicate receipt no. 

 

Loan account no | receipt no | receipt date. 

 

Another table contains the receipt dump. Which i have shared in my earlier problem..

 

Purpose I have to create a relationship between the collection data and receipt dump/distinct receipt dump to find the difference between collection date and BPIS date. 

 

If i create table visual, I am not able to create any relationship between table visual data and the collection data. 

Greg_Deckler
Super User
Super User

Why not just create a relationship between your two tables? 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Yes I tried to create relationship but unable to fetch values from main receipt dump data to distinct receipt dump data like BPIS no and BPIS data

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.