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
SofiaVaz
Helper I
Helper I

Volumes variation by Category/Field

Hi all, 

 

I'm very new on Power BI and I'm dealing with DAX from scratch, so this question may be a little basic...

 

The data model I'm working with has a field called "voy" (voyage number), and other one called "Units" (number of units transported).

 

How can I calculate de number of units varition by voyage? Basically, I want to know how the transported volumes have evolved (exemple: Variation = UnitVoy02-UnitsVoy01).   

 

Thank you all, 

 

Sofia Vaz

1 ACCEPTED SOLUTION

@SofiaVaz

 

OK, that's not allowed with the simplified syntax for the filter argument. Try this instead:

 

UnitsNumberDiff =
[UnitsNumber]
    - CALCULATE (
        SUM ( Table1[Unidades_2] );
        FILTER (
            ALL ( Table1[sst_voyage] );
            Table1[sst_voyage]
                = SELECTEDVALUE ( Table1[sst_voyage] ) - 1
        )
    )

 

Code formatted with   www.daxformatter.com

View solution in original post

10 REPLIES 10

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.