Forum Discussion
anacpint
Helper I
4 years agoTotal value coming from measure is wrong
Hello, I developed this measure: CALCULATE(if([COUNTReport]=2, DIVIDE(SUM(FactOTDJnJPap[measurevalue]),2), SUM(FactOTDJnJPap[measurevalue])), FactOTDJnJPap[IDTypeReportJnJPharma] IN {1,5}) ...
- 4 years ago
Hi anacpint
Pleas tryOTD_TESTE = SUMX ( SUMMARIZE ( FactOTDJnJPap, DimSite[jnj_site], DimTypeReport[type_of_report] ), CALCULATE ( IF ( [COUNTReport] = 2, DIVIDE ( SUM ( FactOTDJnJPap[measurevalue] ), 2 ), SUM ( FactOTDJnJPap[measurevalue] ) ), FactOTDJnJPap[IDTypeReportJnJPharma] IN { 1, 5 } ) )
anacpint
Helper I
4 years agoSo, for this situation, I'm using a fact table named FactOTDJnJPap (which contains the measure values calculated on the db side), a DimTypeReport, a DimSite and a DCalendar. I use this Dim's to filter different visuals. For this specific measure (OTD) I have two graphics:
For both of them I need to do the calculations that I mentioned before, in the first one I have a DAX filter to show just one of the type of reports, but the measures are the same for the 3 lines. When I select on the filter panel just one Site, the values are correct, when I select all of them, the values are wrong. As filter page I have DimTypeReport[type_of_report] is CPV or PQR.
Thank you very much.
tamerj1
Community Champion
4 years agoHi anacpint
Pleas try
OTD_TESTE =
SUMX (
SUMMARIZE ( FactOTDJnJPap, DimSite[jnj_site], DimTypeReport[type_of_report] ),
CALCULATE (
IF (
[COUNTReport] = 2,
DIVIDE ( SUM ( FactOTDJnJPap[measurevalue] ), 2 ),
SUM ( FactOTDJnJPap[measurevalue] )
),
FactOTDJnJPap[IDTypeReportJnJPharma] IN { 1, 5 }
)
)