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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
LesP
Frequent Visitor

Paginated report help using measure and parameter from power bi dataset

Hi all,

 

In have been using SSRS for quite some time, but only recently started using Power BI and DAX. I have a new power bi report that uses a measure that calculates a value based on a parameter. I have a need to build a paginated report that runs off the same dataset. I can get the DAX out (via performance analyser) and into the paginated report OK, but am floundering on how to re-use the measure.

In the power bi report the user will select a date parameter, some columns in the visuals (tables) use this parameter to calculate values via measures. This all works fine in power bi, but I cant fathom out how I can mirror this in the paginated report. This report is based on an existing SSRS report where I have a date parameter that is used in a SQL query that builds the metrics inside the query, I was hoping to be able to mirror this in the DAX but my knowledge of DAX is clearly not sufficient.

 

Thanks in anticipation of help including pointers to articles, videos or solutions.

 

Les

1 ACCEPTED SOLUTION
LesP
Frequent Visitor

I managed to work out a way to achieve what I wanted. Basically I've created new [replicated] measures in the DAX in the paginated report dataset, essentially the same as the originals but using the paginated report parameter as the comparator in the measure. I might have added an unnecessary extra layer in that I also added a VAR vparameter = @parameter and then used the vparameter in the measure, but once I managed to get the parameter settings in everywhere this worked so didnt want to unstrip it. 

I've used parameters for years in SSRS but took me quite some time to work out how to add everything necessary into the DAX query builder. Also for some odd reason the parameter was treated as text rather than a date, even though the parameter was setup as Date/Time, so have to convert (using DATEVALUE) to get it to work on the DAX "query".

Thank you to everyone who took the time to look at my post.

View solution in original post

3 REPLIES 3
LesP
Frequent Visitor

Thanks for the pointers. These I am sure will be useful to refer back to, but I cant see the solution to my query here. I am sure it is down to my lack of knowledge of DAX more than anything. 

In case it helps an example Measure is: 

LeaverAtDate = CALCULATE(COUNT(StudentData[id]),FILTER(StudentData,StudentData[LatestEndDate2] <= 'ReportDate'[Parameter Value])) - in the case of my power BI report this works fine from a parameter date selection. 
In the DAX copied across to report builder I merely have [in one line]: "LeaverAtDate", 'StudentData'[LeaverAtDate] - I am guessing that this really needs to be more than this to use the measure i.e. CALCULATE? and with a reference to a "@" parameter but I just dont know how this should look.

 

LesP
Frequent Visitor

I managed to work out a way to achieve what I wanted. Basically I've created new [replicated] measures in the DAX in the paginated report dataset, essentially the same as the originals but using the paginated report parameter as the comparator in the measure. I might have added an unnecessary extra layer in that I also added a VAR vparameter = @parameter and then used the vparameter in the measure, but once I managed to get the parameter settings in everywhere this worked so didnt want to unstrip it. 

I've used parameters for years in SSRS but took me quite some time to work out how to add everything necessary into the DAX query builder. Also for some odd reason the parameter was treated as text rather than a date, even though the parameter was setup as Date/Time, so have to convert (using DATEVALUE) to get it to work on the DAX "query".

Thank you to everyone who took the time to look at my post.

amitchandak
Super User
Super User

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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