Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Mk60
Resolver I
Resolver I

Compare values change and percent change for selected months only

Trying to recreate this excel summary table and wonder what dax calculation/s would make that possible? I tried some offset calcs, and few other options, but I assume I am not familiar with dax to find solution for this?

I have only one data table named "Query1", which has millions of rows for several dozens of metric/attribute in columns. I am only using 4 metrics here as an example, with actual numbers. My date column comes as text in Query1 so I created calculated column to use for my dates, named as "Posting Date Short". Here's a few pictures that might help for the reference:

My original Date column as text:

Mk60_0-1722450386459.png

My calculated date columns name I use in my visuals:

Mk60_1-1722450437496.png

Final table I would like to recreate: (Mainly how can I calculate or create some new measures for the yellow highlighted cells, $Change, %Change), which should work interactively in case I use some filters, etc. Basically current month values compared to 3 months ago and the same month one year ago. Any suggestions would be much apprecited!

Mk60_2-1722450739737.png

 

2 REPLIES 2
amitchandak
Super User
Super User

@Mk60 , Connect date of you table with date if date table and then you can have measures like

 

current = SUM(Sales[Sales Amount])

trailing QTR = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,QUARTER))

 

Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))

 

Change QOQ = [current]- [trailing QTR]

Change QOQ% = divide([current]- [trailing QTR],[trailing QTR])

 

Change YOY = [current]- [Year behind Sales]

Change YOY% = divide([current]- Year behind Sales],[Year behind Sales])

 

 

for the measure's header grouping consider the calculation group. They can now be created in power bi desktop

Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0

Model explorer public preview with calculation group authoring| Measure Slicer: https://youtu.be/VfxfJJ0RzvU

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi Mr. amitchangak,

 

First, I just wanted to thank you for your time and consideration here! So much appreciate you, not surprised you're a supersuer. Before I try your suggested calcs here, I need to ask you if using your syntax above absolutely requires having an existing Date table? My Query1 is very basic data table and only one column has dates values, (Posting Date as attached in my picture above). If that is requirement to use your calculations, I would not mind to try to build Calendar table, since I heard good things about having one, and it would be another opportunity for me to learn something new anyway. So, is the Date table MUST have in order to use your calcs above? Thanks so much once again! 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.