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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Date Formatting & Date Comparison - Formatting and DAX Help

I have a data set which has 3 columns, all with date relevant informaiton for my report.  I am trying to understand how to best format this information so that Power BI will allow me to compare Annual, Quarterly and Monthly Results.

 

I have provided a sample data set for anyone who want to take this for a test drive.

 

https://www.dropbox.com/s/ru4bnd55noqccef/Sample%20Date%20Sheet.xlsx?dl=0

 

I would like to do Quarter vs. Quarter, Year over Year, and Month over Month Analysis as well as write a DAX statement that shows the difference between the time periods.

 

Any assistance with the formatting of the data recommendations on how to compare the different time periods would be greatly appreciated.

 

Thank you.

12 REPLIES 12
Vvelarde
Community Champion
Community Champion

Hi @Anonymous

 

Follow this video to transform your column in a date column.

 

 

After that use this date column to relation with a calendar table and made your dax to compare years, quarters, month, etc.

 

 

 




Lima - Peru
Anonymous
Not applicable

@Vvelarde @Sean

 

This is great information, very helpful.

 

The only remaining part I am having difficulty with is table in which the relationship is made.  In @Vvelarde video.

 

I created a date table, but editing the relationships will not allow me to proceed.  Also, notice the "line" between the two tables, it does not look like the one seen in the video.

 

Cal 1.PNGCal 2.PNG

Anonymous
Not applicable

@Sean @Vvelarde

 

Any additional insight you may be able to provide?  Really struggling applying the solution and making the connection in the model.

 

Thanks again.

@Anonymous

 

Can you post your entire Window (Relationship), I saw in your screenshot that the relationship is made, why you want to change that.

 

 




Lima - Peru
Anonymous
Not applicable

@Vvelarde

 

Happy to post whatever information you need, and thank you again for the help.  

 

It would appear that the relationship doesn't work the same way as in your video - and I cannot figure out why.  I think it is probably with the Date Table I created.

 

Relationship Table.PNG

 

Anonymous
Not applicable

@Anonymous Try changing your cardinality from One:Many to Many:One instead. The order in the cardinality is the order the tables are listed in the relationship. In your case, the date table is second, so you want the cardinality with the "One" on the right hand side.

Anonymous
Not applicable

@Anonymous

 

Thanks I made the change.  Unforunatley, this is the informaiton that the slicer ouputs.

 

I don't know why the slicer is limiting it to these 2 options (fig. A), the dataset itself is clearly more expansive. (fig. B)

 

fig. A

 

Qtr-Yr.PNG

 

(fig. B)

 

 

 Date Sample.PNG

Anonymous
Not applicable

@Anonymous could you post your .pbix so we can take a look? It will be hard to troubleshoot without looking into the data model in Power BI.

@Anonymous

 

The cardinality is:

 

DateTable - One   to Many DateREF

 

With this the error dissapear and relationships will work.

 

 




Lima - Peru
Sean
Community Champion
Community Champion

@Anonymous

first create the DateRef column as per @Vvelarde's video

then its much easier to get the month number as shown below...

Add Column tab => Date => Month

 

Query Editor - DateRef.gif

 

BTW I do like the Conditional Column Interface its just that the above is much easier in this case Smiley Happy

 

Does anyone know - is there a limit on how many conditions can be entered in the Conditional Column UI in the Query Editor?

@Vvelarde, @ImkeF, @MarcelBeug

Vvelarde
Community Champion
Community Champion

@Sean

 

How can i create the animated image(gif)? Thanks

 

 




Lima - Peru
Sean
Community Champion
Community Champion

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.