Forum Discussion
venug20
Resolver I
8 years agoSum sales , Category is Less than; 10000 (Using DAX Only)
Hi Every one, I have table like this Category Sales a 20000 b 9000 c 8000 d 7000 e 6000 f 5000 g 4000 h 3000 I want to show my table like below (sum...
- 8 years ago
- 8 years ago
HI venug20
Using DAX there could be three ways of doing this
1) Calculated Table
2) Measure
3) Calculated Column
1) CALCULATED TABLE
From the Modelling Tab>>New TableCalculated_Table = CALCULATETABLE ( Table1, FILTER ( VALUES ( Table1[Category] ), CALCULATE ( SUM ( Table1[Sales] ) < 10000 ) ) )2) MEASURE
Measure = IF ( HASONEFILTER ( Table1[Category] ), IF ( SUM ( Table1[Sales] ) < 10000, SUM ( Table1[Sales] ) ), SUMX ( VALUES ( Table1[Category] ), IF ( CALCULATE ( SUM ( Table1[Sales] ) ) < 10000, CALCULATE ( SUM ( Table1[Sales] ) ) ) ) )3) CALCULATED COLUMN
Sales < 10000 = VAR result = CALCULATE ( SUM ( Table1[Sales] ), ALLEXCEPT ( Table1, Table1[Category] ) ) RETURN IF ( result < 10000, result )
- Zubair_Muhammad8 years ago
Community Champion
- venug208 years ago
Resolver I
Hi Zubair,
Thanks for responding, you have given perfect solution for this...
I want same result using "DAX"...... Can you help on this.....
- Zubair_Muhammad8 years ago
Community Champion
HI venug20
Using DAX there could be three ways of doing this
1) Calculated Table
2) Measure
3) Calculated Column
1) CALCULATED TABLE
From the Modelling Tab>>New TableCalculated_Table = CALCULATETABLE ( Table1, FILTER ( VALUES ( Table1[Category] ), CALCULATE ( SUM ( Table1[Sales] ) < 10000 ) ) )2) MEASURE
Measure = IF ( HASONEFILTER ( Table1[Category] ), IF ( SUM ( Table1[Sales] ) < 10000, SUM ( Table1[Sales] ) ), SUMX ( VALUES ( Table1[Category] ), IF ( CALCULATE ( SUM ( Table1[Sales] ) ) < 10000, CALCULATE ( SUM ( Table1[Sales] ) ) ) ) )3) CALCULATED COLUMN
Sales < 10000 = VAR result = CALCULATE ( SUM ( Table1[Sales] ), ALLEXCEPT ( Table1, Table1[Category] ) ) RETURN IF ( result < 10000, result )