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,
I have a star schema with 2 fact tables. I need two metrics from both tables in a new visual table:
# Distinct Count From Call ID Fact1 table = DistinctCount(FACT1[CallID])
# Count of Strategies from FACT 2
The problem is that there are missing strategies from table Fact2.
In the new visual table I need that Calls Id = null for # Count of Strategies metric when strategies don´t exists.
Can you help me with this?
Solved! Go to Solution.
Hello @rmeng. You could do something like this:
# Number of Strategies (FACT 2) =
IF(
ISBLANK(
CALCULATE(
COUNTROWS( 'Fact 2' ),
TREATAS( VALUES( 'Fact 1'[Call ID] ), 'Fact 2'[Calls ID] )
)
),
"null",
CALCULATE(
COUNTROWS( 'Fact 2' ),
TREATAS( VALUES( 'Fact 1'[Call ID] ), 'Fact 2'[Calls ID] )
)
)
I attached a .pbix file here, in case it's helpful.
-Steve
Hi @rmeng ,
According to your screenshot, I think you couldn't make all relationships active or you will get a cycle in data model.
For reference: Manage relationship
Here I choose to inactive "DIM Date"[Date] to "FACT 2"[Date].
You just need to add Strategie column in it and use count function in values field. In your table visual, it will show blank if there is no strategie in Fact2.
Or create a easy measure to show null.
Measure =
VAR _Count = COUNT('FACT 2'[Strategie])
return
IF(ISBLANK(_Count),"null",_Count)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @rmeng ,
According to your screenshot, I think you couldn't make all relationships active or you will get a cycle in data model.
For reference: Manage relationship
Here I choose to inactive "DIM Date"[Date] to "FACT 2"[Date].
You just need to add Strategie column in it and use count function in values field. In your table visual, it will show blank if there is no strategie in Fact2.
Or create a easy measure to show null.
Measure =
VAR _Count = COUNT('FACT 2'[Strategie])
return
IF(ISBLANK(_Count),"null",_Count)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @rmeng. You could do something like this:
# Number of Strategies (FACT 2) =
IF(
ISBLANK(
CALCULATE(
COUNTROWS( 'Fact 2' ),
TREATAS( VALUES( 'Fact 1'[Call ID] ), 'Fact 2'[Calls ID] )
)
),
"null",
CALCULATE(
COUNTROWS( 'Fact 2' ),
TREATAS( VALUES( 'Fact 1'[Call ID] ), 'Fact 2'[Calls ID] )
)
)
I attached a .pbix file here, in case it's helpful.
-Steve
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
18 | |
15 | |
12 | |
11 | |
8 |
User | Count |
---|---|
24 | |
18 | |
12 | |
11 | |
10 |