Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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 of Sales should be less than 10000)
Category | Sales |
b | 9000 |
c | 8000 |
d | 7000 |
e | 6000 |
f | 5000 |
g | 4000 |
h | 3000 |
Totals | 42000 |
Can you help on this... Thanks in Advance
Solved! Go to Solution.
You can use VISUAL level filters
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 Table
Calculated_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 )
You can use VISUAL level filters
Hi Zubair,
Thanks for responding, you have given perfect solution for this...
I want same result using "DAX"...... Can you help on this.....
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 Table
Calculated_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 )
Please see each page in the attached file
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
70 | |
55 | |
37 | |
31 |
User | Count |
---|---|
83 | |
64 | |
63 | |
49 | |
45 |