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.
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!!!
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 |
---|---|
49 | |
26 | |
21 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |