Forum Discussion
Creating a Card for displaying the previous months count
- 8 years ago
Hi adamsumm,
The column opened_at contains time parts that isn't necessary in this scenario. The most important point is the time part is bad for the relationship.
1. Create a new column:
Relationship = [Opened_at].[Date]
2. Establish relationship between this table and the date table.
3. Two measures.
CurrentMonthAmount = count(Table1[Number])
PreviousMonthAmount = VAR currentAmount = COUNT ( Table1[Opened_at] ) VAR previousAmount = CALCULATE ( COUNT ( 'Table1'[Opened_at] ), PREVIOUSMONTH ( 'Calendar'[Date] ) ) RETURN IF ( previousAmount < currentAmount, CONCATENATE ( previousAmount, UNICHAR ( 9660 ) ), IF ( previousAmount > currentAmount, CONCATENATE ( previousAmount, UNICHAR ( 9650 ) ), previousAmount ) )Best Regards!
Dale
Hi adamsumm,
The column opened_at contains time parts that isn't necessary in this scenario. The most important point is the time part is bad for the relationship.
1. Create a new column:
Relationship = [Opened_at].[Date]
2. Establish relationship between this table and the date table.
3. Two measures.
CurrentMonthAmount = count(Table1[Number])
PreviousMonthAmount =
VAR currentAmount =
COUNT ( Table1[Opened_at] )
VAR previousAmount =
CALCULATE ( COUNT ( 'Table1'[Opened_at] ), PREVIOUSMONTH ( 'Calendar'[Date] ) )
RETURN
IF (
previousAmount < currentAmount,
CONCATENATE ( previousAmount, UNICHAR ( 9660 ) ),
IF (
previousAmount > currentAmount,
CONCATENATE ( previousAmount, UNICHAR ( 9650 ) ),
previousAmount
)
)
Best Regards!
Dale
Thank you v-jiascu-msft for the solution, is there anyway from this code, I can set the color red (negative), grey (blank or 0) and green (positive) for both # of differences and the unichar arrows? (see the screenshot below)
Thank you.
amitchandak are there any chance you might know this?