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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Mitsch
New Member

Need Help DAX - Comparing Periods

Hi, 
Im quite new to Power Bi , i hope someone can help me with my topic.

I need help displaying 2 different periods of Data.

 

I get this error when trying to display my Measure


Mitsch_0-1674742696917.png

What do i want to do:

I just want to compare 2 periods of Data - one period is from 2021 - the other is from 2020.

 

What have i done so far :

 

1) I have imported tables from a MS SQL Database  - No direct query

The Table with the Data ( especially the clomn with the date ) looks like this.
All Data is in one Table.

Mitsch_2-1674743335230.png

 

2) i have set the displayed filters on the visual - so far so good - data displays right on the visuals


Mitsch_1-1674742914320.png

 

 

3)  now i want an additional column with data (comparison)  with the 2020 period data
As far as i know "measure´s" are the right thing to accomplish that.

4) My Measure looks like this: 

 

 

Measure = calculate(sum('Verkauf lvRechnungsposition'[fBruttoPreisGesamt]),DATEADD('Verkauf lvRechnungsverwaltung'[dErstellt],-3,YEAR))

 

 


Once i drop the measure into my visual i get the error above

 

I can not identify the error here, i dont know what i have done wrong.

I hope someone can give me a hint on this.
Thank you !
Mitsch

 

2 REPLIES 2
amitchandak
Super User
Super User

@Mitsch , You need to use date table for that

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...

 

refer

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

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

@amitchandak  Thank you i will consider this

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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