Forum Discussion
custom matrix
Trying to build a custom matrix using the community blog guide (https://community.powerbi.com/t5/Community-Blog/Creating-a-custom-or-hybrid-matrix-in-PowerBI/ba-p/1354591)
Having an issue where my measure being called in the matrix calculation is having a mismatch as there is a difference in text and date formats. Any ideas?
The Dax for the matrix values is as follows:
What's the code for all 3 measures in the IF functions?
The culprit is probably the [Hybrid Prod Total] measure. Are you using a relationship from the hybrid table to the date table, or using TREATAS?
What you need to be aware if is that the Date field in the hybrid table is actually of type text, whereas the column the [Hybrid Prod Total] measure is referencing (via a relationship or using TREATAS) is probably formatted as a date.
So what you need to do, is create a duplicate column of the date field in the Date table or fact table (the table you are referencing in the [Hybrid Prod Total] measure), and format it as text. Then use this date text field as the reference in the [Hybrid Prod Total] measure. Make sense?
3 Replies
- PaulDBrownCommunity Champion
What's the code for all 3 measures in the IF functions?
The culprit is probably the [Hybrid Prod Total] measure. Are you using a relationship from the hybrid table to the date table, or using TREATAS?
What you need to be aware if is that the Date field in the hybrid table is actually of type text, whereas the column the [Hybrid Prod Total] measure is referencing (via a relationship or using TREATAS) is probably formatted as a date.
So what you need to do, is create a duplicate column of the date field in the Date table or fact table (the table you are referencing in the [Hybrid Prod Total] measure), and format it as text. Then use this date text field as the reference in the [Hybrid Prod Total] measure. Make sense?
- JebilayaHelper III
Spot on PaulDBrown . Thxs
- PaulDBrownCommunity Champion
Actually, thinking about it, it's probably more efficient to leave the Date table/fact table as is, and add a new column to the hybrid table using:
New Date field = IF('Hybrid Table'[Index] >2, 'Hybrid Table[Date])
and format it as date type
And then use this new field in the relationship/TREATAS expression.