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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
sahooak
Helper I
Helper I

How to replicate a tableau Calculation in Power BI

hello Everyone,

I need help with this. I need to replicate one Tableau Calculation into DAX

I have this below tableau calucation

IF [Order Day Number] < [CurrentDayNumber]
THEN { SUM([Ship Amt CQ Pull In])}
         END

Ship Amt CQ Pull In=
IF [PullInFlag] = 'Y'
AND [Current Fiscal Quarter] = 0
AND [Product]="Chair"
THEN [Ship Amt] END

For the Fixed LOD Part I have created this below measure in power BI-which is giving exact output like tableau. But I dont know how I can implement this condition [Order Day Number] < [CurrentDayNumber] in my DAX

VAR FilteredTable =
    FILTER(
        ALL('Data'),
        'Data'[Product] = "Chair"
    )
VAR TotalShip =
    CALCULATE(
        [Ship Amt CQ Pull In] ,
        FilteredTable
    )
    RETURN
    TotalShip

 

 

Thank you,
AS

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@sahooak , try one of the two

CALCULATE(
[Ship Amt CQ Pull In] ,
allexcept('Data', 'Data'[Product] ), 'Data'[Product] = "Chair"
)

or

CALCULATE(
sumx(filter('Data'), 'Data'[Product] = "Chair"), [Ship Amt CQ Pull In] ,
allexcept('Data', 'Data'[Product] )
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

v-dineshya
Community Support
Community Support

Hi @sahooak ,

Thank you for reaching out to the Microsoft Community Forum.

 

Please refer below DAX measure.

 

Ship Amt CQ Pull In LOD =
VAR FilteredTable =
FILTER(
ALL('Data'),
'Data'[Product] = "Chair"
&& 'Data'[Order Day Number] < 'Data'[CurrentDayNumber]
)
RETURN
CALCULATE(
[Ship Amt CQ Pull In],
FilteredTable
)

 

Please refer below DAX measure without variables.

 

Ship Amt CQ Pull In LOD =
CALCULATE(
[Ship Amt CQ Pull In],
ALL('Data'),
'Data'[Product] = "Chair",
'Data'[Order Day Number] < 'Data'[CurrentDayNumber]
)

 

I hope this information helps. Please do let us know if you have any further queries.

 

Regards,

Dinesh

View solution in original post

9 REPLIES 9
v-dineshya
Community Support
Community Support

Hi @sahooak ,

Thank you for reaching out to the Microsoft Community Forum.

 

Please refer below DAX measure.

 

Ship Amt CQ Pull In LOD =
VAR FilteredTable =
FILTER(
ALL('Data'),
'Data'[Product] = "Chair"
&& 'Data'[Order Day Number] < 'Data'[CurrentDayNumber]
)
RETURN
CALCULATE(
[Ship Amt CQ Pull In],
FilteredTable
)

 

Please refer below DAX measure without variables.

 

Ship Amt CQ Pull In LOD =
CALCULATE(
[Ship Amt CQ Pull In],
ALL('Data'),
'Data'[Product] = "Chair",
'Data'[Order Day Number] < 'Data'[CurrentDayNumber]
)

 

I hope this information helps. Please do let us know if you have any further queries.

 

Regards,

Dinesh

Hi @sahooak ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.

 

Regards,

Dinesh

Hi @sahooak ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.

 

Regards,

Dinesh

amitchandak
Super User
Super User

@sahooak , try one of the two

CALCULATE(
[Ship Amt CQ Pull In] ,
allexcept('Data', 'Data'[Product] ), 'Data'[Product] = "Chair"
)

or

CALCULATE(
sumx(filter('Data'), 'Data'[Product] = "Chair"), [Ship Amt CQ Pull In] ,
allexcept('Data', 'Data'[Product] )
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
MattiaFratello
Super User
Super User

TotalShip_Chair_CQ_PullIn = 
CALCULATE(
    SUM('Data'[Ship Amt]),
    'Data'[Product] = "Chair",
    'Data'[PullInFlag] = "Y",
    'Data'[Current Fiscal Quarter] = 0,
    FILTER(
        ALL('Data'),
        'Data'[Order Day Number] < 'Data'[CurrentDayNumber]
    )
)

 

Try the above.

 

If this helps, please mark it as a solution and give kudos 👍

Thank you for you reply. Your DAX is giving same values in each row.

this condition should work first

[Order Day Number] < [CurrentDayNumber] then that Fixed LOD Part.
amitchandak
Super User
Super User

@sahooak , for Fixed LOD refer my video there few thing need to considered 

If the first one a column

Ship Amt CQ Pull In =
IF (
    'Table'[PullInFlag] = "Y"
        && 'Table'[Current Fiscal Quarter] = 0
        && 'Table'[Product] = "Chair",
    'Table'[Ship Amt],
    BLANK()
)


measure like 

Ship Amt CQ Pull In (Filtered Sum) =
VAR _CurrentDay = MAX('Table'[CurrentDayNumber])
RETURN
CALCULATE(SUM('Table'[Ship Amt CQ Pull In]),
    'Table'[Order Day Number] < _CurrentDay
)

 

 

Or a measure like , without column 

Ship Amt CQ Pull In (Filtered Sum) =
VAR _CurrentDay = MAX('Table'[CurrentDayNumber])
RETURN
CALCULATE(
    SUMX(Filter( 'Table',   'Table'[PullInFlag] = "Y"
        && 'Table'[Current Fiscal Quarter] = 0
        && 'Table'[Product] = "Chair")
    'Table'[Ship Amt]),
    'Table'[Order Day Number] < _CurrentDay
)


for LOD in Tableau vs Power BI - FIXED Level of Detail- https://youtu.be/hU-cVOwDCvY

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you for your reply. Your DAX is not working.
For the Fixed LOD I have created this is DAX which shows the same output like Tableau. BUT how can I add this 

[Order Day Number]<[CurrentDayNumber]
VAR FilteredTable =
    FILTER(
        ALL('Data'),
        'Data'[Product] = "Chair"
    )
VAR TotalShip =
    CALCULATE(
        [Ship Amt CQ Pull In] ,
        FilteredTable
    )
    RETURN
    TotalShip

  

@sahooak , try one of the two

CALCULATE(
[Ship Amt CQ Pull In] ,
allexcept('Data', 'Data'[Product] ), 'Data'[Product] = "Chair"
)

or

CALCULATE(
sumx(filter('Data'), 'Data'[Product] = "Chair"), [Ship Amt CQ Pull In] ,
allexcept('Data', 'Data'[Product] )
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.