Forum Discussion
b2wise
Helper III
3 years agoCompare two measures to evaluate dimension status
Hi All, I'm stuck on something that seems easy. I'm not using my actual data to try and keep things simple. Essentialy I am comparing the last two "Sold Out" columns (which are measures withi...
- 3 years ago
Hi b2wise ,
Try the following code:
Fix = VAR temp_table = CALCULATETABLE ( GROUPBY ( SUMMARIZE ( 'Table', 'Table'[Region], 'Table'[Item] "TEST", [Sold Out ERP M] = [Sold Out WMS] ), 'Table'[Item], [TEST] ), REMOVEFILTERS ( 'Table'[Region] ) ) RETURN IF ( CONTAINSSTRING ( CONCATENATEX ( temp_table, [TEST] ), "FALSE" ), "YES", "NO" ) - 3 years ago
Thanks MFelix for answering my question. Your measure works!
I didn't get a chance to post but I asked this question to ChatGPT and it gave me a similar formula but it didn't work. I changed ChatGPT's code a little and that works as well.
Fix Measure = CALCULATE(IF ( COUNTROWS ( FILTER ( ADDCOLUMNS ( SUMMARIZE ( 'test table', 'test table'[Item], 'test table'[Region], "SoldOutERP", SUM ( 'test table'[Sold Out ERP] ), "SoldOutWMS", SUM ( 'test table'[Sold Out WMS] ) ), "Mismatch", [SoldOutERP] <> [SoldOutWMS] ), [Mismatch] = TRUE() ) ) > 0, "Yes", "No" ) , ALL('test table'[Region]) )Thanks again!
MFelix
Super User
3 years agoHi b2wise ,
Try the following code:
Fix =
VAR temp_table =
CALCULATETABLE (
GROUPBY (
SUMMARIZE (
'Table',
'Table'[Region],
'Table'[Item]
"TEST", [Sold Out ERP M] = [Sold Out WMS]
),
'Table'[Item],
[TEST]
),
REMOVEFILTERS ( 'Table'[Region] )
)
RETURN
IF (
CONTAINSSTRING ( CONCATENATEX ( temp_table, [TEST] ), "FALSE" ),
"YES",
"NO"
)
b2wise
Helper III
3 years agoThanks MFelix for answering my question. Your measure works!
I didn't get a chance to post but I asked this question to ChatGPT and it gave me a similar formula but it didn't work. I changed ChatGPT's code a little and that works as well.
Fix Measure =
CALCULATE(IF (
COUNTROWS (
FILTER (
ADDCOLUMNS (
SUMMARIZE (
'test table',
'test table'[Item],
'test table'[Region],
"SoldOutERP", SUM ( 'test table'[Sold Out ERP] ),
"SoldOutWMS", SUM ( 'test table'[Sold Out WMS] )
),
"Mismatch", [SoldOutERP] <> [SoldOutWMS]
),
[Mismatch] = TRUE()
)
) > 0,
"Yes",
"No"
)
, ALL('test table'[Region])
)
Thanks again!