Skip to main content
cancel
Showing results for 
Search instead 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

Reply
SKC18
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 

 

 

 

SKC18_0-1720436967843.png

 

1 ACCEPTED SOLUTION
v-xiandat-msft
Community Support
Community Support

Hi @SKC18 ,

Below is my table:

vxiandatmsft_0-1721724812802.png

Firstly , you can create a table for slicer:

vxiandatmsft_1-1721724894211.pngvxiandatmsft_2-1721724906830.png

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:

vxiandatmsft_3-1721724956637.png

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.

 

View solution in original post

2 REPLIES 2
v-xiandat-msft
Community Support
Community Support

Hi @SKC18 ,

Below is my table:

vxiandatmsft_0-1721724812802.png

Firstly , you can create a table for slicer:

vxiandatmsft_1-1721724894211.pngvxiandatmsft_2-1721724906830.png

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:

vxiandatmsft_3-1721724956637.png

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.

 

foodd
Super User
Super User

Please remember to adhere to the decorum of the Community Forum when asking a question.

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.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

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

Helpful resources

Announcements
Europe Fabric Conference

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.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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