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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Nobie
Helper II
Helper II

Tableau to Power bi Fixed LoD

Hi Friends,

I need a help , not abe to resolve since many days.
i have a expression in Tableau

sum(

     { FIXED [Product], [Product Area],[Product Line],[Product ID]:
       sum( 
               { FIXED [Product],[Product Line],[working Days],[Shift],[WorkID]:  avg([SOMM])  }   )
      }   
    )

for the inner one   sum( { FIXED [Product],[Product Line],[working Days],[Shift],[WorkID]:  avg([SOMM])  }   )
 i tried to use calculate( average(SOMM),
   allexcept( table,"table"Product],"table"[Product Line],"table"working Days],"table"[Shift],"table"[WorkID]))
but the value I am getting is 350 and in tableau its 20000+.
Thankyou for any help.

2 REPLIES 2
v-yanjiang-msft
Community Support
Community Support

Hi @Nobie ,

It's because you only averaged and did not sum in the DAX formula. Here's my solution, create a measure.

Measure =
VAR _T =
    ADDCOLUMNS (
        'Table',
        "avg",
            DIVIDE (
                CALCULATE (
                    AVERAGE ( 'Table'[SOMM] ),
                    ALLEXCEPT (
                        'Table',
                        'Table'[Product],
                        'Table'[Product Line],
                        'Table'[working Days],
                        'Table'[Shift],
                        'Table'[WorkID]
                    )
                ),
                COUNTROWS (
                    FILTER (
                        'Table',
                        'Table'[Product] = EARLIER ( 'Table'[Product] )
                            && 'Table'[Product Line] = EARLIER ( 'Table'[Product Line] )
                            && 'Table'[working Days] = EARLIER ( 'Table'[working Days] )
                            && 'Table'[Shift] = EARLIER ( 'Table'[Shift] )
                            && 'Table'[WorkID] = EARLIER ( 'Table'[WorkID] )
                    )
                )
            )
    )
RETURN
    SUMX ( _T, [avg] )

I create a sample to test, I attatch it below for your reference.

 

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

Best regards,

Community Support Team_yanjiang

Hi @v-yanjiang-msft 
thanks for the solution, the solution didn't worked. But it was nice to have some clarity.
for the inner Fixed I have written a code , and this code and ur code gives the same wrong result
CODE:
Var avg= average('Table'[SOM])
calculate(
SUMX(
SUMMARIZE ('Table',
                          'Table'[Product],'Table'[Line],Table[Working Day],Table[Shift],Table[Worker Id],
                        "inner",avg),[inner]))
                           

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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