Forum Discussion
AlanP514
4 years agoPost Patron
Dax Error
Hai All I need help on this Requirement: Want to create a pie chart 1 by default it should show max month otherwise it should show selected month v/s category column(column consist of different c...
- 4 years ago
Please try
CM = VAR MaxMonth = CALCULATE ( MAX ( Initiative[Year Month] ), REMOVEFILTERS ( 'Calendar' ) ) VAR SelectedMonth = SELECTEDVALUE ( 'Calendar'[Year Month] ) VAR FinalMonth = IF ( [Is Year Filtered] = TRUE (), MaxMonth, SelectedMonth ) RETURN CALCULATE ( [# Model Number], 'Calendar'[Year Month] = FinalMonth )
Ashish_Mathur
4 years agoSuper User
Hi,
The Data type of _finalyear is alphanumeric (I assume) whereas the data type of Year_month is numeric. that is reason fo the error.
- AlanP5144 years agoPost Patron
- Ashish_Mathur4 years agoSuper User
Hi,
Do not create Year Month number and Year Month name columns. Create 3 seperate columns - Year, Month name and Month number.