Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi All,
I have two tables one is direct query and other is import model.
Direct Query Table:
Import Table:
Import Table consists of Month, Station ID and Expected Energy
Month | Station Id | Expected Energy |
Basically, I need to create relationships in such a way that
IF (Table 1[Eac-MFM] > 0 , Table 2 [Expected Energy], 0)
I tried creating a relationship between the month in both tables and it created many to many relationships but I am not able to execute the above if condition because of direct query limitations.
Solved! Go to Solution.
Hi,
According to your description, i create two simple tables to test:
DirectQuery table
Import table
Then create a measure:
Measure =
IF (
COUNTROWS ( 'Sales-2' ) > 0,
IF (
SUM ( 'Sales-1'[Sales] ) > 0,
CALCULATE (
SUM ( 'Sales-2'[Expected Sales] ),
'Sales-2'[Category] IN FILTERS ( 'Sales-1'[Category] )
),
0
)
)
Add this measure to DirectQuery table(Sales-1) as a table visual and it shows:
Best Regards,
Giotto Zhi
Hi,
According to your description, i create two simple tables to test:
DirectQuery table
Import table
Then create a measure:
Measure =
IF (
COUNTROWS ( 'Sales-2' ) > 0,
IF (
SUM ( 'Sales-1'[Sales] ) > 0,
CALCULATE (
SUM ( 'Sales-2'[Expected Sales] ),
'Sales-2'[Category] IN FILTERS ( 'Sales-1'[Category] )
),
0
)
)
Add this measure to DirectQuery table(Sales-1) as a table visual and it shows:
Best Regards,
Giotto Zhi
User | Count |
---|---|
141 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
123 | |
101 | |
71 | |
61 |