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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
pmadam
Helper II
Helper II

Dax Help

Hi Team,

 

I have requirement where SSRS report has fixed current year values , previous year values and the variance of both. 

 

I have now got requirement where to in  Power BI report  and it  should no longer be only a static this year vs last year comparison, but instead allows an adjustable time period (ex: last x weeks/months to previous x weeks/months, this period to same period last year, etc.).

 

pmadam_0-1677479424348.png

 

 

Please suggest.

 

Thanks,

Prathy

3 REPLIES 3
andhiii079845
Solution Sage
Solution Sage

Hi Prathy,
you can create a table and a field with the selcted duration as a text. The DAX measure can than do the correkt calculation via switch. Do you have some anymous sample datas? 

Filtertext
compare to last month
compare to last week




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi Andhi @andhiii079845 

 

Im not sure how Switch works but please fidn the attached sample data.

I have booking data with Date tables in it.

Kidly sugguest for below filter models.

 

Filter
CY Vs PY
CQ VS PrvQ
CQ VS PY SameQ
CM VS PM
CM VS PY SM

 

pmadam_0-1677732244232.png

 

Perhaps you upload some non sensitive data via onedrive or something like this. in the best case the pbi file. The structure of the underlaying data has to be clear





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.