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
foyiq
Advocate I
Advocate I

Measure calculating from different tables

Dears,

 

I have two different types of periods - actual and budget. For each I have different source files with absolutely different information. Is it possible to create a measure that would switch the calculations for two different statuses?
For example, for Third Party Trade Receivables incurred in case of budget I'd use the following measure:

Third Party Trade Receivables inc = CALCULATE(sum('Incurred'[Liabilities Incurred]); 'Incurred'[Counterparty Group]="Third Party"; Incurred'[Category]="Revenue from Sales of Products and Services")

 

For the same indicator but in actual mode I use this measure:

 

Third Party Trade Receivables inc = CALCULATE(sum('Sales'[Revenue]); 'Sales'[Group]="Third Party") + CALCULATE(sum('PL'[Sum]; 'PL'[Item]="Revenue from Services").

 

So, the question is, how could I merge these two measures, so that in the report I could avoid changing the columns on visualizations each time, when I would change the status from actual to budget and vice versa?

 

I tried using IF statement, but my measures are in a separate table which has no relationships with other tables, so it seems not to work.

The status slicer comes in the reports from the related table. The relationships are as follows:

08.06.png

 

Thank you beforehand.

1 ACCEPTED SOLUTION
v-ljerr-msft
Employee
Employee

Hi @foyiq,

 

Could you try the formula below to see if it works in your scenario? Smiley Happy

Third Party Trade Receivables inc =
IF (
    HASONEVALUE ( 'Slicer'[Slicer] );
    IF (
        VALUES ( 'Slicer'[Slicer] ) = "budget";
        CALCULATE (
            SUM ( 'Incurred'[Liabilities Incurred] );
            'Incurred'[Counterparty Group] = "Third Party";
            'Incurred'[Category] = "Revenue from Sales of Products and Services"
        );
        CALCULATE ( SUM ( 'Sales'[Revenue] ); 'Sales'[Group] = "Third Party" )
            + CALCULATE ( SUM ( 'PL'[Sum] ); 'PL'[Item] = "Revenue from Services" )
    )
)

 

Regards

View solution in original post

3 REPLIES 3
v-ljerr-msft
Employee
Employee

Hi @foyiq,

 

Could you try the formula below to see if it works in your scenario? Smiley Happy

Third Party Trade Receivables inc =
IF (
    HASONEVALUE ( 'Slicer'[Slicer] );
    IF (
        VALUES ( 'Slicer'[Slicer] ) = "budget";
        CALCULATE (
            SUM ( 'Incurred'[Liabilities Incurred] );
            'Incurred'[Counterparty Group] = "Third Party";
            'Incurred'[Category] = "Revenue from Sales of Products and Services"
        );
        CALCULATE ( SUM ( 'Sales'[Revenue] ); 'Sales'[Group] = "Third Party" )
            + CALCULATE ( SUM ( 'PL'[Sum] ); 'PL'[Item] = "Revenue from Services" )
    )
)

 

Regards

sokg
Solution Supplier
Solution Supplier

Check this out https://www.youtube.com/watch?v=jXkGbNDAslo

 

I think your part is after 15:00.

@sokgThank you very much! I will get back to this video in no time.

@v-ljerr-msft Thank you, let me try this. It definitely looks like it's gonna work!

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.