Forum Discussion
DISTINCOUNT IF certain condition met
- 5 years ago
Hello, ckhoo2007
I create two measures to sum total in pie chart. I also modified the total to make it display correctly. You can check the below sample file.
Like this:
Measure1 = SUMX ( ADDCOLUMNS ( ADDCOLUMNS ( SUMMARIZE ( ALLSELECTED( Sales ), Sales[Client], "t30", CALCULATE ( DIVIDE ( SUMX ( 'Sales', 'Sales'[Sales] * 'Sales'[Transactions] ), SUM ( 'Sales'[Transactions] ) ), DATESINPERIOD ( Sales[Date], MAX ( Sales[Date] ), -30, DAY ) ), "t60", CALCULATE ( DIVIDE ( SUMX ( 'Sales', 'Sales'[Sales] * 'Sales'[Transactions] ), SUM ( 'Sales'[Transactions] ) ), DATESINPERIOD ( Sales[Date], MAX ( Sales[Date] ) - 30, -30, DAY ) ) ), "t30-t60", [t30] - [t60] ), "bb", IF ( [t30-t60] > 0, 1 ) ), [bb] )Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.
Best Regards,Community Support Team _ Janey
Sorry some correction, when I try to plot the improved or degraded in a chart it all shows improved.....
Thanks Nidhi, let me work out the sample data set and share later.
- NidhiBhusari5 years ago
Helper IV
Hey ckhoo2007 I tried implementing this scenario that "when I try to plot the improved or degraded in a chart it all shows improved....." using pie chart and as per my analysis I think if your measure generates negative values and are used in pie chart then it won't appear in visual.
- ckhoo20075 years ago
Helper I
but that's why I used Distinctcount which should count only those improved or degraded hence botn are positive numbers.....