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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
amyvgordon
Frequent Visitor

Using measure filtered by date with field parameters

Hi All, 

 

I am trying to use field parameters to change the axis on a column chart that displays a measure.

 

The measure being displayed is as follows:

 

 

 

 

DashboardCore = 

Var Maximumdate = CALCULATE(MAX('DateTable'[DateTime]),ALLSELECTED('DateTable'[DateTime])) 
Var Minimumdate = IF([SelectedFilter]="Single Week",CALCULATE(MIN('DateTable'[DateTime]),ALLSELECTED('DateTable'[DateTime])),CALCULATE(MIN('DateTable'[FinancialYearStart]),ALLSELECTED('DateTable'[DateTime])))
   
Return CALCULATE (  
      SUM ('Visitors'[Visitors Actual]), 
      ALL ('DateTable'), 
      'DateTable'[DateTime] <= Maximumdate, 
      'DateTable'[DateTime] >= Minimumdate

) 

 

 

 

 

I know this measure produces the correct totals as I have the figures displaying on cards elsewhere in the report. I have a slicer running from the SelectedFilter table that allows users to view for a single week, or the year to date for the date selected.  

 

I would like to be able to change the x axis of my chart to view totals split by hour, week day or month. I have added these three fields (all of which are in the datetime table) to a set of field parameters. 

 

This works well for week day and hour, but for the monthly view, all of the data appears in the month of the date selected in my slicer, rather than the date from the Visitors table. 

 

I'm assuming that this is something to do with the way I've filtered the data in the variables at the beginning of my measure, but I'm unsure how to change this whilst maintaining both bits of functionality. 

 

Many thanks in advance for your help. 

0 REPLIES 0

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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