Forum Discussion
IF statement for each row
- Anonymous3 years ago
Hi Paritäa ,
According to your description, here are my steps you can follow as a solution.
(1) Enter data.
(2) We can create a calculated column.
Sum of value = SWITCH( [Row name], "0-9.9",SUMX(FILTER('Table (2)',[Value]>=0&&[Value]<10),[Value]), "10-19.9",SUMX(FILTER('Table (2)',[Value]>=10&&[Value]<20),[Value]), "20-29.9",SUMX(FILTER('Table (2)',[Value]>=20&&[Value]<30),[Value]), "30-39.9",SUMX(FILTER('Table (2)',[Value]>=30&&[Value]<40),[Value]), "40-49.9",SUMX(FILTER('Table (2)',[Value]>=40&&[Value]<50),[Value]), "+50",SUMX(FILTER('Table (2)',[Value]>50),[Value]))(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1. create an index column in PQ
2. use DAX to create a group column
group = if('Table'[Index]<50, int('Table'[Index]/10)+1,6)
3. use DAX to create a column to check if the value is in the scope
Column =
if('Table'[Value]>=('Table'[group]-1)*10 &&'Table'[Value]<('Table'[group]+1)*10,"Yes")
4. create a measure
Measure = CALCULATE(sum('Table'[Value]),'Table'[Column]="Yes")
pls see the attachment below
I'd also like to try your version but I don't even know how to enter Power Query and therefore add index columns. I tried with online tutorials but the all have PQ already open.
My only tab options in the Home tab is:
Sorry, it's German but as you can see, I only have the option to add a "basic" column but there are no options to choose what type of columns to add.
- ryan_mayu3 years agoSuper User
i think I misunderstood your request.
my solution may not fit your situation.
Let's see Anonymous 's solution
1. you can change the column type
2. it should display values
pls see the attachment below