Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi!
I have an issue with distinctcount function:
We have sales table with actual data in January 2017 and January 2018.
For example:
date | point_key | amount |
01.01.2017 | 111 | 200 |
01.01.2017 | 333 | 100 |
01.01.2017 | 222 | 300 |
01.01.2017 | 333 | 400 |
01.01.2018 | 111 | 100 |
01.01.2018 | 444 | 400 |
01.01.2018 | 555 | 200 |
01.01.2018 | 111 | 300 |
I can take DISTINCTCOUNT of point_keys if I select filter (January 2018) in month = CALCULATE(DISTINCTCOUNT([point_key])) = 3
I can take DISTINCTCOUNT of point_keys in same month of prior year = CALCULATE(DISTINCTCOUNT([point_key]);DATEADD('Calendar'[Date];-1;YEAR)) = 3
The matter is how to get increment and decrement in unique point_keys between CY and PY?
in our case we can see that point_key 555 has appeared in January 2018 and point_key 222 has disappeared from January 2017.
Well, can I put increment and decrement into different calculated measures?
I've tried for increment SUMX(ADDCOLUMNS(mytable;"stream";IF(DISTINCTCOUNT([point_key]) - CALCULATE(DISTINCTCOUNT([point_key]);DATEADD('Calendar'[Date];-1;YEAR))=1;1;BLANK()));[stream])
but it sums rows in fact_table 😞
Hi Supaplex,
For further test, could you please provide more details about CY , PY? In addtion, are [stream], [increment] and [decrement] the measures you have created? Could you please clarify these measures and your expected result?
Regards,
Jimmy Tao
Hi!
I have an issue with distinctcount function:
We have sales table with actual data in January 2017 and January 2018.
For example:
date | point_key | amount |
01.01.2017 | 111 | 200 |
01.01.2017 | 333 | 100 |
01.01.2017 | 222 | 300 |
01.01.2017 | 333 | 400 |
01.01.2018 | 111 | 100 |
01.01.2018 | 444 | 400 |
01.01.2018 | 555 | 200 |
01.01.2018 | 111 | 300 |
I can take DISTINCTCOUNT of point_keys if I select filter (January 2018) in month = CALCULATE(DISTINCTCOUNT([point_key])) = 3
I can take DISTINCTCOUNT of point_keys in same month of prior year = CALCULATE(DISTINCTCOUNT([point_key]);DATEADD('Calendar'[Date];-1;YEAR)) = 3
The matter is how to get increment and decrement in unique point_keys between CY and PY?
in our case we can see that point_key 555 has appeared in January 2018 and point_key 222 has disappeared from January 2017.
Well, can I put increment and decrement into different calculated measures?
I've tried for increment SUMX(ADDCOLUMNS(mytable;"stream";IF(DISTINCTCOUNT([point_key]) - CALCULATE(DISTINCTCOUNT([point_key]);DATEADD('Calendar'[Date];-1;YEAR))=1;1;BLANK()));[stream])
but it sums rows in fact_table 😞
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
81 | |
70 | |
62 |
User | Count |
---|---|
148 | |
116 | |
104 | |
90 | |
65 |