Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

End of chart needs to be the month of current date

Hello,  the ending date of the chart needs to be the month of the current date. I created a calendar table 

 
Table = CALENDAR(DATE(YEAR(TODAY())-1;MONTH(TODAY());01);TODAY())
( i want just 1 year of information in this chart, but another years on the dashboard)
 
and a measure
 
Measure = IF(ISBLANK(DISTINCTCOUNT(fOrder[K_NumberOrder]));0;DISTINCTCOUNT(fOrder[K_NumberOrder]))
(i need to fill the empty records with zero)

When i put the line chart ( Table[Date] (hierarchy with year and month) in axis and measure in values), the axis go until December 2019 (but the last record in my calendar is february 27). If i choose the date(with days) the chart bring me the right dates




PowerBiLine.png
1 ACCEPTED SOLUTION
v-cherch-msft
Employee
Employee

Hi @Anonymous 

 

You use the Date Hierarchy.So please try to use below measures:

Measure =
IF (
    MAX ( 'Table'[Date].[Date] ) <= TODAY (),
    IF (
        ISBLANK ( DISTINCTCOUNT ( fOrder[K_NumberOrder] ) ),
        0,
        DISTINCTCOUNT ( fOrder[K_NumberOrder] )
    )
)

Or

Measure 2 =
IF (
    MAX ( 'Table'[Date].[Date] ) <= TODAY (),
    CALCULATE ( DISTINCTCOUNT ( fOrder[K_NumberOrder] ) ) + 0
)

Regards,

Cherie

 

 

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-cherch-msft
Employee
Employee

Hi @Anonymous 

 

You use the Date Hierarchy.So please try to use below measures:

Measure =
IF (
    MAX ( 'Table'[Date].[Date] ) <= TODAY (),
    IF (
        ISBLANK ( DISTINCTCOUNT ( fOrder[K_NumberOrder] ) ),
        0,
        DISTINCTCOUNT ( fOrder[K_NumberOrder] )
    )
)

Or

Measure 2 =
IF (
    MAX ( 'Table'[Date].[Date] ) <= TODAY (),
    CALCULATE ( DISTINCTCOUNT ( fOrder[K_NumberOrder] ) ) + 0
)

Regards,

Cherie

 

 

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Can i use the same measure for the quarter?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.