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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Anonymous
Not applicable

Dynamic Axis Power BI Chart

I have three tables

Dim_calendar and Sheet1 and for selection purposes I created one field parameters slicer

I have a slicer which I created using field parameters whose values are WOW & MOM

If I click WOW dynamic axis should change and values should show for these three measures in one chart with a weak comparison

 

1 Views

2 Orders

3 CVR
These are measures I need to showcase measures with WOW

if i click mom i need to see the same measures with Month comparison

 

1 Views

2 Orders

3 CVR

Here I am not able to find the pbix attaching option so I am attaching the data and measures and calendar table dax which i am using 

# CVR = SUM(Sheet1[CVR])
# Orders = SUM(Sheet1[Orders])
# Views = SUM(Sheet1[Views])





Start _DateViewsOrdersCVR
1/1/20216294741703
1/2/20219634641670
1/3/20214761511735
1/4/202124343483
1/5/20216625004052
1/6/20211725476334
1/7/202163854125
1/8/20217374151650
1/9/20214433283581
1/10/202110074543604
1/11/20213664781706
1/12/2021678242820
1/13/202118952884214
1/14/202114851981661
1/15/20211948693163
1/16/20211724393221
1/17/20211893693960
1/18/2021854461962
1/19/20211448319779
1/20/2021125976941
1/21/202111704862546
1/22/2021932502804
1/23/202189302029
1/24/20211614933556
1/25/202110782822968
1/26/20211128344573
1/27/202110604311832
1/28/20219803382654
1/29/202112863813364
1/30/20214624452562
1/31/202117593742474
2/1/20215874252906
2/2/20215194772349
2/3/202119073983013
2/4/202119643434356
2/5/20211843464256
2/6/202112573951364
2/7/2021534051287
2/8/20217634844237
2/9/20211553942145
2/10/202119552384674
2/11/20213672342732
2/12/202116714051711
2/13/20211133378536
2/14/20211865496364
2/15/20211205782286
2/16/202111912103582
2/17/20213621844684
2/18/20211252502601
2/19/202111332072693
2/20/202110703883468
2/21/202118863683658
2/22/20216231283254
2/23/2021643321538
2/24/2021836276936
2/25/202119202414484
2/26/2021120140960
2/27/20216542572416
2/28/20214592143624
3/1/2021171038377
3/2/202110263863467
3/3/20213112194892
3/4/202115722704460
3/5/202111782203001
3/6/20211988322896
3/7/202116881002146
3/8/20216393781974
3/9/2021184604187
3/10/2021732632181
3/11/2021120155220
3/12/20216571061234
3/13/202113304514994
3/14/20211486234480
3/15/20215732754740
3/16/2021453234589
3/17/20213282211526
3/18/2021400703697
3/19/20215903831945
3/20/202110902773480
3/21/2021618941379
3/22/20218272263148
3/23/20216634263659
3/24/202119173671959
3/25/20219284631179
3/26/20214591412242
3/27/20213381551876
3/28/202112232133671
3/29/20215551332033
3/30/2021364142053
3/31/202117824184881
4/1/20211752662283
4/2/20215983793639
4/3/202117844123629
4/4/202114854051456
4/5/2021544574764
4/6/20219353911268
4/7/202118114903485
4/8/202110012624090
4/9/202115634574624



Dim_Calendar =
var _FromDate= MIN(Sheet1[Start _Date])
var _ToDate= MAX(Sheet1[Start _Date])

var _Today=TODAY()

return
ADDCOLUMNS(
    CALENDAR(_FromDate,_ToDate)
    ,"Year",YEAR([Date])
    ,"Year Start Date",DATE( YEAR([Date]),1,1)
    ,"Year End Date",DATE( YEAR([Date]),12,31)

    ,"Quarter",QUARTER([Date])
    ,"Quarter Name","Q"&FORMAT([Date],"Q")
    ,"Quarter Start Date",DATE( YEAR([Date]), (QUARTER([Date])*3)-2, 1)
    ,"Quarter End Date",EOMONTH(DATE( YEAR([Date]), QUARTER([Date])*3, 1),0)    
    ,"Year Quarter Number",COMBINEVALUES("-",YEAR([Date]),FORMAT( QUARTER([Date]),"00"))

    ,"Month",MONTH([Date])
    ,"Month Name",FORMAT([Date],"MMMM")
    ,"Month Name Short",FORMAT([Date],"MMM")
    ,"Month Start Date",DATE( YEAR([Date]), MONTH([Date]), 1)
    ,"Month End Date",EOMONTH([Date],0)
    ,"Year Month Number",FORMAT([Date],"YYYY-MM")
    ,"Year Month Name",FORMAT([Date],"YYYY-MMM")

    ,"Week of Year",WEEKNUM([Date])
    ,"Week Start Date", [Date]-WEEKDAY([Date])+1
    ,"Week End Date",[Date]+7-WEEKDAY([Date])
    ,"Year Week Number", COMBINEVALUES("-",YEAR([Date]),FORMAT( WEEKNUM([Date]),"00"))

    ,"Day",DAY([Date])
    ,"Day Name",FORMAT([Date],"DDDD")
    ,"Day Name Short",FORMAT([Date],"DDD")
    ,"Day of Week",WEEKDAY([Date])    
   
    ,"Days in Month",DATEDIFF(DATE( YEAR([Date]), MONTH([Date]), 1),EOMONTH([Date],0),DAY)+1
    ,"Day Offset",DATEDIFF(_today,[Date],DAY)
    ,"Month Offset",DATEDIFF(_today,[Date],MONTH)
    ,"Quarter Offset",DATEDIFF(_today,[Date],QUARTER)
    ,"Year Offset",DATEDIFF(_today,[Date],YEAR)
)

alanpjames_0-1676304780567.png

 



1 REPLY 1
mark_endicott
Super User
Super User

It sounds like you need a calculation group, rather than a field parameter as that will be able to change all three measures at once. 

 

You can read more on calculation groups for time intelligence here: https://www.sqlbi.com/articles/introducing-calculation-groups/

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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