Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Dear Community,
While working on one of the requirement where I wanted to replace Blank values with 0 using measure yielded unexpected result when I am using matrix.
1st Matrix uses Actual, Budget & forecast directly from table. Some values are Null. When I am using slicer to filter the data based on year (like 2019, 2020, 2021) only data [ertaining to these years are being shown, which is as expected.
Now the requirement is to show 0 instead of Blanks in Actual and Budget fields. so I used 2 measures mentioned below in 2nd table
Thanks in advance.
Solved! Go to Solution.
Hi @mohitkr_01 ,
For the initial issue, I have tested for a long time, but can't find any solutions for this issue. This may caused by the back-end operating mechanism - SUMMARIZECOLUMNS function.
You can get the query by "Performance Analyzer" -> "Start Recording" -> "Refresh visuals" -> Copy query of your matrix.
In your scenario, the filterTable is generated from column 'Table'[Date] and the groupBy_columnName is 'Date[Date]'. The filterTable value doesn't contain in the groupBy_columnName.
Therefore, the only way we can do is to use the same column in matrix and slicer. Just as what I set in my initial .pbix file.
And for the blank "expenses", it is caused by the one-to-one relationship, not sure the specific reason. But you can change the relationship to One('Date'[Date])-to-Many('Table'[Date]). Then the issue will disappear.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @mohitkr_01 ,
I can't reproduce your issue. Please check if I ignore anything:
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello
Thanks for Sharing the report, It was able to get the expected result by using the date from Date(Date Dimension) table in the matrix.
To reporduce the issue you can use the Date from 'Table' (The fact table) as Matrix Column.
I noticed that there is an extra row with no Expense values but have 0s in Actual, Budget and Forecast.
Although I have excluded it from Matrix but do yu have any idea why that's happening?
Thanks & Regards,
Mohit
Hi @mohitkr_01 ,
For the initial issue, I have tested for a long time, but can't find any solutions for this issue. This may caused by the back-end operating mechanism - SUMMARIZECOLUMNS function.
You can get the query by "Performance Analyzer" -> "Start Recording" -> "Refresh visuals" -> Copy query of your matrix.
In your scenario, the filterTable is generated from column 'Table'[Date] and the groupBy_columnName is 'Date[Date]'. The filterTable value doesn't contain in the groupBy_columnName.
Therefore, the only way we can do is to use the same column in matrix and slicer. Just as what I set in my initial .pbix file.
And for the blank "expenses", it is caused by the one-to-one relationship, not sure the specific reason. But you can change the relationship to One('Date'[Date])-to-Many('Table'[Date]). Then the issue will disappear.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@mohitkr_01 Hey Mate,
Try this measure =
Measure's name doesn't influence its result result, even though I gave it the try.
I have selected 2020 in slicer but matrix shows fields for 2019 and 2021.
@mohitkr_01 Can you share the screenshot of modeling view . I wanted to check . Is there any relationship in between your both table . It seems like there is a bad model working in your report
And yes name does not change but it will ease someone life when you are not working on that report .
Cheers.
Here we go.
@mohitkr_01 This will happen one to one relationship.I will suggest .
Kindly 2 new col. in table .
Year = Year (table [date])
Month = Format(Table[date],"Mmm-yy")
Then try .
i hope it will work for you
I think this measure is equivalent to, sumActual = if(ISBLANK(SUM('Table'[Actual])),0,sum('Table'[Actual]))
I got the same result as previous by using " null to 0 = IF(SUM(Sheet1[Budget])= BLANK(),0,SUM(Sheet1[Budget]))"
@amitchandak : I tried the measure, I modified it as below:
@mohitkr_01 , Just want to check the year in slicer and year in matrix visual, both coming from date table?
No the date in matrix is from Fact table but the year in Slicer is from Date dimension.
@mohitkr_01 , if you use isblank or +0 measure, it makes a left join and shows all values.
This is example, what I end up doing to control it with in range , when I am using a date tbale
0 between range
Measure = var _1= SUM(Opportunity[Opportunity count]) +0
var _min = minx(ALLSELECTED('Calendar'), 'Calendar'[Date])
var _max = maxx(ALLSELECTED('Calendar'), 'Calendar'[Date])
return
CALCULATE(if(max('Calendar'[Date]) <_min || max('Calendar'[Date]) >_max , BLANK(), _1))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
124 | |
79 | |
49 | |
38 | |
38 |
User | Count |
---|---|
196 | |
80 | |
70 | |
51 | |
42 |