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

Compare with "where" and dateadd (same period last year)

Hi all,

 

Need assistant with creating a compare for values created this month with same period -1 year (last year)

- Im able to get the result when not using filters (where)

- Date columns exist

 

Goal

Create a dashboard that presents rows that differs more then 20 % (+ or -) from same period last year

This report are to be used to compare the data before the invoicing process starts

 

Dataset

eriweste_0-1662099532142.png

 

Need to compare (ex) the period Aug (08-22) with Aug (08-21)

 

The TSQL/ps1 would be like (simplified - do not laugh :))

$1 = Select _consumption where readingdate = Aug 2022 and quantitycodevalue = 'kvarh' and readingstatus = '2'

$2 = Select _consumption where readingdate = Aug 2021 and quantitycodevalue = 'kvarh' and readingstatus = '3'

 

if $1  $2 > Diff then 20 % of value of $1 = Display res 

 

(plz note that readingstatus differs (2 = Approved, 3 = Billed))

 

Any ideas

Br

erik

2 REPLIES 2
daXtreme
Solution Sage
Solution Sage

Have a look at this pattern.

Hi, 

Thanks for the reply. The DATE "issue" is handled (getting the correct period to compare)

 

Main issue is to correctly using the "where" perspective (filter), if not the SUM of all _consumptions are being presented. I need the individual rows to be compared (Kvarh, Hög, låg etc)

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!

November Carousel

Fabric Community Update - November 2024

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

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.