Forum Discussion
DAX formula
- Anonymous2 years ago
Hi V3Rn3r_8-6
Use measure instead of calculate column, pbix file attached.Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Anonymous2 years ago
Hi V3Rn3r_8-6
Please try the following calculate column:
Realllll = VAR _count = CALCULATE(COUNTROWS('Table'),FILTER(ALL('Table'),'Table'[Name]=EARLIER('Table'[Name])&&'Table'[Date]=EARLIER('Table'[Date]))) RETURN IF ( CALCULATE ( SUM ( 'Table'[Total Orders on shift] ), FILTER ( ALL ( 'Table' ), 'Table'[Name] = EARLIER('Table'[Name]) && 'Table'[Shift] = "O" &&'Table'[Date]=EARLIER('Table'[Date]) ) ) > CALCULATE ( SUM ( 'Table'[Total Orders on shift] ), FILTER ( ALL ( 'Table' ), 'Table'[Name] = EARLIER('Table'[Name]) && 'Table'[Shift] = "N" &&'Table'[Date]=EARLIER('Table'[Date]) ) ), _count&"x"&"O", IF ( CALCULATE ( SUM ( 'Table'[Total Orders on shift] ), FILTER ( ALL ( 'Table' ), 'Table'[Name] = EARLIER('Table'[Name]) && 'Table'[Shift] = "N" &&'Table'[Date]=EARLIER('Table'[Date]) ) ) > CALCULATE ( SUM ( 'Table'[Total Orders on shift] ), FILTER ( ALL ( 'Table' ), 'Table'[Name] = EARLIER('Table'[Name]) && 'Table'[Shift] = "R" &&'Table'[Date]=EARLIER('Table'[Date]) ) ), _count&"x"&"N", _count&"x"&"R" ) )Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello,
Please, when I apply this formula to my spreadsheet, I get the same result in all rows, namely "xR". What could be the error?
Thank you very much
Hi V3Rn3r_8-6
Please provide sample data that fully covers your issue and the expected outcome based on the sample data you provided.(In the form of a table or PBIX file, not a screenshot)
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- V3Rn3r_8-62 years agoFrequent Visitor
- Anonymous2 years agoNot applicable
Hi V3Rn3r_8-6
Use measure instead of calculate column, pbix file attached.Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- V3Rn3r_8-62 years agoFrequent Visitor
Hello,
Please, could it be done so that the calculation is in a new column in Table view instead of the way it is now as a new measurement? The way it is, when I apply it to the original table, it takes too long to load because of the large amount of data and especially I need to use this result to filter different data
Thank you very much.