Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello
I have the data:
A | 1 | 01/01/2020 |
B | 2 | 02/01/2020 |
C | 3 | 03/02/2020 |
E | 4 | 04/02/2020 |
D | 5 | 05/03/2020 |
D | 6 | 06/03/2020 |
How can I calculate the distinct number of Col1, where Col2 is >2 and group the results by month?
So the result should be:
Jan=0
Feb=2
Mar=1
Thanks!
Solved! Go to Solution.
Hi @UsePowerBI ,
Here are the steps you can follow:
1. Create calculated column.
Month = MONTH('Table'[Date])
Month_mmm = FORMAT([Date],"mmm")
2. Create measure.
Measure =
var _2=CALCULATE(DISTINCTCOUNT('Table'[Column1]),FILTER('Table','Table'[Column2]>2&&'Table'[Month]=MAX('Table'[Month])))
return IF(_2=BLANK(),0,_2)
3. Result.
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @UsePowerBI ,
Here are the steps you can follow:
1. Create calculated column.
Month = MONTH('Table'[Date])
Month_mmm = FORMAT([Date],"mmm")
2. Create measure.
Measure =
var _2=CALCULATE(DISTINCTCOUNT('Table'[Column1]),FILTER('Table','Table'[Column2]>2&&'Table'[Month]=MAX('Table'[Month])))
return IF(_2=BLANK(),0,_2)
3. Result.
You can downloaded PBIX file from here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
you can create a column
month = FORMAT('Table'[Column3],"mmm")
then create a measure
Measure = CALCULATE(DISTINCTCOUNT('Table'[Column1]),FILTER('Table','Table'[Column2]>2))+0
Proud to be a Super User!
@UsePowerBI , Create a measure like this
calculate(distinctcount(Table[col1]), filter(Table, Table[col2] >2))+0
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
89 | |
86 | |
75 | |
69 | |
68 |
User | Count |
---|---|
214 | |
128 | |
117 | |
82 | |
76 |