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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Hakuchha
Frequent Visitor

passing date parameter in calculated measure like Tableau

Hi,

 

I have a Tableau report which needs to be converted to PowebI. In Tableau, I have a date parameter and it is passed into two different date columns in the table. How do I replicate that in Power BI?

 

Here is an example 

name of parameter = dateparm

and here is 1st calculation

IFNULL( IF
([Policy Date]>= (datetrunc('month',[dateparm]) ) and
[Policy  Date]<=[dateparm])

[Revenue]
ELSE
0

End,0)

 

here is 2nd calculation in the same report

 

IFFNULL( IF
([Post Date]>= (datetrunc('month',[dateparm]) ) and
[Post Date]<=[dateparm])

)
Then
[TotalSales]
ELSE
0

End,0)

9 REPLIES 9
v-yalanwu-msft
Community Support
Community Support

Hi, @Hakuchha ;

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi, @Hakuchha ;

As far as I know it is possible. As follows:

vyalanwumsft_0-1662358812156.png

vyalanwumsft_1-1662358828700.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

somehow this is not working if I  do not display either pol date or postdate. is it possible to make it work without showing any dimensions? just those two calculated measures.

instead of using a calculated parameter table, can I use a standalone date table from my DB for this? some how its not working.

 

v-yalanwu-msft
Community Support
Community Support

Hi, @Hakuchha ;

You could create a parameter table.

parameter = CALENDAR(DATE(2022,1,1),TODAY())

Then create measures.

revenuesum = IF(MAX('Table'[pol date])>=EOMONTH( MAX('parameter'[dateparm]) ,-1)+1&& MAX('Table'[pol date])<=MAX('parameter'[dateparm]),SUM('Table'[revenue]),0)
salessum = IF(MAX('Table'[pol date])>=EOMONTH( MAX('parameter'[dateparm]) ,-1)+1&& MAX('Table'[pol date])<=MAX('parameter'[dateparm]),SUM('Table'[sales]),0)

The final show:

vyalanwumsft_0-1662087608309.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

thanks for your help. Can we display dateparm box as a calender instead of the list where users can pick any value easily.

Hakuchha
Frequent Visitor

if you look at the above table, it has postdate and pol date which is a "policy date" and revenue and sales.

"'dateparm" is a user input parameter that will calculate two new fields for the report using the above calculation.

 

 

Hakuchha
Frequent Visitor

postdatepol daterevenuesales
8/22/20228/16/20229451368429.3
8/25/20228/28/202219772144259.8
8/9/20228/9/20222255038184271.8
8/4/20222/1/2022712.974538.83
8/16/20227/31/2022268.919288.68
8/17/202211/5/202197200.84944.97
8/11/20229/5/20212480.96-706.1
8/3/202210/5/2021-2961-370.12
8/26/20223/17/2022126817.68
8/10/20228/7/202245048435184.51
8/9/20225/18/2022-2718-643.73
8/17/202211/8/202113161001.36
8/17/20224/1/2022123641.64950.57
8/15/20228/19/202264986855.62
parry2k
Super User
Super User

@Hakuchha it will be easier if you paste a sample data with the expected output. 

 

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.