Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello dear Community,
im pretty new to PowerBI and DAX and i have a particular Problem i cant solve.
I wanted to create a Measure which counts the distinct Date events, where units where sold. Therefore i am Expecting 2, because there are 3 Dates where stuff is sold, but the 01.12.2020 units sold value is blank.
Customer ID | Order ID | Product | Units Sold | Date | Revenue | Cost |
2 | 183779 | Oatmeal Raisin | 01.12.2020 | 3075 | 1353 | |
3 | 580583 | Oatmeal Raisin | 01.12.2020 | 9580 | 4215.2 | |
2 | 707082 | Oatmeal Raisin | 01.12.2020 | 6250 | 2750 | |
2 | 734809 | Oatmeal Raisin | 1'236 | 01.11.2020 | 6180 | 2719.2 |
2 | 544809 | Oatmeal Raisin | 941 | 01.11.2020 | 4705 | 2070.2 |
3 | 170867 | Oatmeal Raisin | 1'143 | 01.10.2020 | 5715 | 2514.6 |
4 | 131700 | Oatmeal Raisin | 1'269 | 01.10.2020 | 6345 | 2791.8 |
Therefore i tried the following Measure:
But what comes out is gibberish. Can someone help me here? I think i havent understood something fundamental in PowerBI.
Thank you very much!!! P.S. sorry for my english.
Solved! Go to Solution.
Hi @Womkas_90
Please try
=
COUNTROWS (
FILTER (
VALUES ( Orders[Date] ),
CALCULATE ( SUM ( Orders[Units Sold] ) ) <> BLANK ()
)
)
Hi, @Womkas_90
You can also try the following methods.
countdistinctdays =
CALCULATE (
DISTINCTCOUNT ( Orders[Date] ),
FILTER ( ALL ( Orders ), 'Orders'[Units Sold] <> BLANK () )
)
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Womkas_90
Please try
=
COUNTROWS (
FILTER (
VALUES ( Orders[Date] ),
CALCULATE ( SUM ( Orders[Units Sold] ) ) <> BLANK ()
)
)
Yes it works, thank you so much!!!
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |