cancel
Showing results 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.

Anonymous
Not applicable

## Dax Filter

Hello, I tried to find a solutiuon for what I am trying to accomplish via this Forum and Youtube and I am grasping some concepts but unable to piece them together.  I have a column with data from different periods with associated values. I require a total of each period and then subtract those those totals. For instance Sum of 2020 P2 - Sum of 2020 P1. I am guessing that I have to use a Sum command and a Filter Command.

1 ACCEPTED SOLUTION
Super User

@Anonymous , Create a new period Table and create a rank on the period

Period Rank = RANKX(all('Period'),'Period'[Period],,ASC,Dense)
This Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Date'[Period Rank]=max('Date'[Period Rank])))
Last Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Date'[Period Rank]=max('Date'[Period Rank])-1))

Same approch I followed for week

Super User

@Anonymous , Create a new period Table and create a rank on the period

Period Rank = RANKX(all('Period'),'Period'[Period],,ASC,Dense)
This Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Date'[Period Rank]=max('Date'[Period Rank])))
Last Period = CALCULATE(sum('order'[Qty]), FILTER(ALL('Period'),'Date'[Period Rank]=max('Date'[Period Rank])-1))

Same approch I followed for week

Announcements

#### 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

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors