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.
Hi All,
I have a requirement to show the blank values in my matrix as 0 with my date in column shelf of matrix. But when I use my created measure in the matrix, it starts showing all the dates (which are not even part of my data).
I have tried various suggestions provided to use a different date table, link it with primary table and use it in the matrix. But I am still getting the same result (i.e. all months). Please help with your inputs or alternative suggestions. Below is my scenario in detail.
1) Original Output:
2) Created measure to show as 0:
3) Result with Sales_ZN measure: (showing all the months)
Getting the same output when creating a separate date table, linking it with original primary table and using the date field in matrix.
4) Expected Output:
Thanks!
Solved! Go to Solution.
Hi @Sm95 ,
Try this formula:
Sales_ZN =
IF (
ISBLANK (
CALCULATE (
MAX ( 'Table'[Sales] ),
ALLEXCEPT ( 'Table', 'Table'[Year], 'Table'[Month] )
)
),
BLANK (),
SUM ( 'Table'[Sales] ) + 0
)
Best Regards,
Jay
Hi @v-jayw-msft ,
Thanks a lot for the suggestion. This is working as expected. Just a question, could you please explain why have you used MAX function in CALCULATE? I got the expected values using SUM as well, instead of MAX.
CALCULATE ( MAX ( 'Table'[Sales] ), ALLEXCEPT ( 'Table', 'Table'[Year], 'Table'[Month] ) )
Hi @Sm95 ,
Yes, you could use SUM() as well.
If the all the value in that column is blank, both max and sum will be blank.
Best Regards,
Jay
Hi @Sm95 ,
Try this formula:
Sales_ZN =
IF (
ISBLANK (
CALCULATE (
MAX ( 'Table'[Sales] ),
ALLEXCEPT ( 'Table', 'Table'[Year], 'Table'[Month] )
)
),
BLANK (),
SUM ( 'Table'[Sales] ) + 0
)
Best Regards,
Jay
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 |
---|---|
109 | |
99 | |
74 | |
63 | |
62 |
User | Count |
---|---|
143 | |
104 | |
102 | |
81 | |
66 |