Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
108 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |