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
ITManuel
Responsive Resident
Responsive Resident

Issue with transfering filter with TREATAS involving two columns

Hi,

 

i have the following data model:

DataModel.png

PurmI is a table containing invoices. CashOUT the respective payments. The link between the two tables are the "LINKCODECASHOUT" columns in both tables. A physical relationship in the model would be a Many to Many relationship. 

I would like the CashOUT table to be filtered by the Date table & the PurmI table. PurmI is filtered by several others tables also, Projects, suppliers, etc.

 

I managed to filter the CashOUT table by the PurmI table with a virtual relationship, using the following measure. 

CashOUTGrossEUR = 
    CALCULATE (
        [CashOUTGrossEUR],
        TREATAS ( VALUES ( PurmI[LINKCODECASHOUT] ), CashOUT[LINKCODECASHOUT] )
    )

Filters from Projects, Suppliers etc. are consequently filtering also CashOUTGrossEUR.

 

When I filter by date, the payments are shown on the date of the invoice, not of the real payment from CashOUT which is understandable.

 

I tried the following measure with the intention to move the filter from 'Date'[Date] to CashOUT[BOOKINGDATE] and the filter from PurmI[LINKCODECASHOUT] to CashOUT[LINKCODECASHOUT) however the measure returns only blank and I don't understand why!?!

CashOUTGrossEUR = 
      CALCULATE (
            [CashOUTGrossEUR],
            TREATAS (
                SUMMARIZE ( PurmI, 'Date'[Date], PurmI[LINKCODECASHOUT] ),
                CashOUT[BOOKINGDATE],
                CashOUT[LINKCODECASHOUT]
            )
        )

 

Best regards

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@ITManuel , Try like

CashOUTGrossEUR =
CALCULATE (
[CashOUTGrossEUR],
TREATAS ( VALUES ( PurmI[LINKCODECASHOUT] ), CashOUT[LINKCODECASHOUT] ),
TREATAS ( VALUES ( 'Date'[Date]), CashOUT[BOOKINGDATE] )

)

Hi @amitchandak ,

 

i tried your proposed measure, but its still not working. The measure is filtered by PurmI[LINKCODECASHOUT], however when the filter is coming from  'Date'[Date], the measure returns blank.

 

Br

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.