cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Regular Visitor

## How to make a column in a matrix that one for this weeks percentage another for pervious week%

I need to make a table such that in the same table it will have comparision for date wise difference one of this week another for pervious week before and so on It should be in as a column beside percentage of tanks as pervious weeks

1 ACCEPTED SOLUTION
Community Support

Hi @SKC18 ,

Below is my table:

Firstly , you can create a table for slicer:

Then you can create a measure:

``````Difference =
var _lastndays= CALCULATE(SUM('Table'[percentage of tanks]),FILTER(ALL('Table'),[Fill Efficency]=MAX('Table'[Fill Efficency])&&'Table'[Date] >= NOW() - SELECTEDVALUE('Last N Days'[Last N Days])))
var _tillnow=CALCULATE(SUM('Table'[percentage of tanks]),FILTER(ALL('Table'),[Fill Efficency]=MAX('Table'[Fill Efficency])))
RETURN  _tillnow - _lastndays``````

Since there are product dates, I choose today's time as the basis for calculating the fundamental.

Then the final output is shown in the following figure:

You can choose the parameter above to dynamically get the percentage difference between different time periods

If you want to achieve dynamic results , it is recommended to use measure instead of column.

The difference between column and measure is in the detail link:www.thedataschool.com.au

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 REPLIES 2
Community Support

Hi @SKC18 ,

Below is my table:

Firstly , you can create a table for slicer:

Then you can create a measure:

``````Difference =
var _lastndays= CALCULATE(SUM('Table'[percentage of tanks]),FILTER(ALL('Table'),[Fill Efficency]=MAX('Table'[Fill Efficency])&&'Table'[Date] >= NOW() - SELECTEDVALUE('Last N Days'[Last N Days])))
var _tillnow=CALCULATE(SUM('Table'[percentage of tanks]),FILTER(ALL('Table'),[Fill Efficency]=MAX('Table'[Fill Efficency])))
RETURN  _tillnow - _lastndays``````

Since there are product dates, I choose today's time as the basis for calculating the fundamental.

Then the final output is shown in the following figure:

You can choose the parameter above to dynamically get the percentage difference between different time periods

If you want to achieve dynamic results , it is recommended to use measure instead of column.

The difference between column and measure is in the detail link:www.thedataschool.com.au

Best Regards,

Xianda Tang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Super User

Please provide your work-in-progress Power BI Desktop file (with sensitive information removed) that covers your issue or question completely in a usable format (not as a screenshot). You can upload the PBIX file to a cloud storage service such as OneDrive, Google Drive, Dropbox, or to a Github repository, and then share a file’s URL.

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

This allows members of the Forum to assess the state of the model, report layer, relationships, and any DAX applied.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Fabric Community Update - August 2024

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

Top Solution Authors
Top Kudoed Authors