Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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!!!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
11 | |
10 | |
9 | |
8 |
User | Count |
---|---|
17 | |
12 | |
11 | |
11 | |
11 |