March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi Guys, I create a matrix table as below :
As you can see from the table, the table is filled with status (open, closed , etc...). I would like to create a if else condition where those blank show "pending" else "submitted".
Hope can get some response from you all. Thank you.
Solved! Go to Solution.
Hi @TanHY, there are multiple ways to handle values present in dimensional table, which are not available in fact table (e.g. W11):
Good luck with developing your report!
Hi @Sergii24 ,
Thanks for your prompt reply. May I know how should I write the IF statement? I am thinking of that too.., but the outcomes seems similar like the table i shown. I also thinking of using cross filtering, but worry about the sizes of my data model.
Hope can get your reply. Thank you.
Hi @TanHY, actually calculated column won't solve the problem: it can replace values "Open" and "Close" with something else, such as "Submitted", but nothing will happen to unexisitng combinations (such as W00 - CLB ).
We'll need a measure to work with those cell. The measure we're going to create will search for values in fact tables, but when result is blank, it will be replaced with "Pending" text.
New Status =
VAR _CurrentStatus = SELECTEDVALUE( 'Fact Table'[Status], "Pending" ) //get the value of status for matrix intersection. If not present (i.e. not existing rows in fact table), then write "Pending"
RETURN
IF(
_CurrentStatus <> "Pending", //if variable is not pending, it means we've managed to get a value "open" or "closed", so we simply replace output with "Submitted"
"Submitted",
_CurrentStatus
)
And here is the comparsion of outputs:
The model and tables used:
Dimensional Table:
Fact table:
Hi @Sergii24 ,
Your solution is helpful! Thanks. One more challenge part is, the key (as per your data model) might have some data is not related to the Fact Table, eg
[Key]:
W001, W002, W11
"Fact Table"[Key]:
W001, W002
In this case, the measure you provided will make the matrix pop out another column which is W11, with all "Pending".
Can this be solve ? Or I should clean the data out , in this case, I will just left join fact table with the [Key] table.
Hope can get your reply. Thanks
Hi @TanHY, there are multiple ways to handle values present in dimensional table, which are not available in fact table (e.g. W11):
Good luck with developing your report!
Hi @TanHY, you can ahieve it by creating a necessary calculated column with your IF statement and then drag and drop it to the matrix instead of Status 😉
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
97 | |
95 | |
84 | |
52 |
User | Count |
---|---|
208 | |
162 | |
91 | |
88 | |
72 |