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.
Hello All,
I have created the below pivot table :
I need to replace the blank values by 0. The Segment column and the Brand column both come from the same Dim Table.
The mesure is a count of of a column in the fact table. Some of the brands don't have a relationship with all the segments.
I need it to show as 0 because when I transform the pivot table in a bar chart, all the segment still need to show on the bar chart and not disapear when it is blank. For example, if I select Automet on a filter, then the bar chart will only show the bus&coach segment. Instead, I still need the bar chart to show me the other segment with no values like below:
I have tried IF(ISBLANK(count(column)), 0, count(column))
How could I fix it ?
Thanks
Solved! Go to Solution.
It works better when rows and columns are coming from separate dimension/table
Please provide sample data.
Previous posters already hinted at this, but if the "+ 0" doesn't work, then the issue is with your dimension table not containing the Segment/Brand combinations you want to show zeros for. This can't be solved with a dax measure.
So either make sure the dimension table contains these combinations or otherwise create an additional dimension table and link that to the fact.
@sjoerdvn thanks for the help. They do contain the combinations. I think I will just create a separte dimensions.
Did you try it inside your transformation table with the folowing DAX statement?
modified_column =
IF (
LEN ( column[Name] ) = 0, 0,column[Name]
)
It works better when rows and columns are coming from separate dimension/table
Please provide sample data.
So fact table would be as below:
Column(to count) | BrandID |
aaa | 1 |
bbbb | 2 |
zzz | 3 |
ee | 4 |
rrz | 5 |
ete | 6 |
zr | 7 |
er | 8 |
The dim table would be as below:
segment | Brand | BrandID |
Bus&Coach | VOLVO | 1 |
COMMERCIAL | VOLVO | 2 |
HEAVY | VOLVO | 3 |
MEDIUM | VOLVO | 4 |
Bus&Coach | VOLKSWAGEN | 5 |
COMMERCIAL | VOLKSWAGEN | 6 |
LIGHT | VOLKSWAGEN | 7 |
Bus&Coach | VDL | 8 |
You can try this count(column)+0
User | Count |
---|---|
20 | |
14 | |
11 | |
8 | |
6 |
User | Count |
---|---|
23 | |
23 | |
20 | |
15 | |
10 |