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.
I want to create a line chart which has "date" as X-axis and count of "product_key" as Y-axis.
And blank should be zero. So I create this measure but unfortunately it reports zero when date comes over limit such as 2019/10/1 and 2020/1/1. How can I set BLANK() when date comes over limit? Thank you.
date | product_key |
2019/11/1 | 1 |
2019/11/1 | 2 |
2019/12/1 | 2 |
2019/10/1 | 3 |
2019/11/1 | 3 |
2019/12/1 | 3 |
count_product_key =
IF (
CALCULATE ( COUNT('table'[product_key]) ) = BLANK (),
0,
CALCULATE ( COUNT('table'[product_key]) )
)
Solved! Go to Solution.
itsnot a DAX question, I think
you could set filter visual count_product_key2 is greater then 0, for example
I m not sure how exactly do you want to see a result, for example for point 2019 December and product_key=1
Hi @Mackie
COUNT() function should not return BLANK(), it should be a digit like 0
So, try
count_product_key =
IF (
CALCULATE ( COUNT('table'[product_key]) ) = 0,
BLANK(),
CALCULATE ( COUNT('table'[product_key]) )
)
Hi, @az38 .
I tried your measure but it does not report zero properly.
Could you download this Power BI file and open it? I created two charts using my measure and your measure.
And the problem I want to solve is shown in this picture. That is to remove the unccesary part.
itsnot a DAX question, I think
you could set filter visual count_product_key2 is greater then 0, for example
I m not sure how exactly do you want to see a result, for example for point 2019 December and product_key=1
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 |