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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ShyamS
Frequent Visitor

Need help in converting below tableau formula to power bi

Hello All,

It will be very helpful if anyone can help me out to convert this tableau formula to power bi measure.

SUM((FIXED DATEPART('quarter', [Calendar Day)), DATEPART('year', [Calendar Day]): SUM(IF DATEPART('quarter', [Calendar Day]) = DATEPART('quarter', [Current Day MY]-1) and DATEPART('year', [Calendar Day)) DATEPART('year', [Current Day MY]-1) THEN [WORKING DAY YTD] END))).

Thank you in advance for your quick response and valuable time.

2 REPLIES 2
Anonymous
Not applicable

Hi @ShyamS 

 

Thanks for the reply from @Greg_Deckler , please allow me to provide another insight:

Here's a DAX formula that should provide the equivalent functionality:

Measure =
VAR CurrentQuarter =
    QUARTER ( MAX ( 'Table'[Current Day MY] ) ) - 1
VAR CurrentYear =
    YEAR ( MAX ( 'Table'[Current Day MY] ) )
VAR PreviousQuarterEnd =
    IF (
        CurrentQuarter = 0,
        DATE ( CurrentYear - 1, 12, 31 ),
        EDATE ( DATE ( CurrentYear, CurrentQuarter * 3, 1 ), -1 )
    )
VAR PreviousQuarterStart =
    EDATE ( PreviousQuarterEnd, -2 )
RETURN
    CALCULATE (
        SUM ( 'Table'[WORKING DAY YTD] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Calendar Day] >= PreviousQuarterStart
                && 'Table'[Calendar Day] <= PreviousQuarterEnd
        )
    )

Please note, you might need to adjust the table and column names () to match your actual data model in Power BI.

 

If the above one can't help you, could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And 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

Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Greg_Deckler
Community Champion
Community Champion

@ShyamS Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.