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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Values till the selected month

Hi Community,

I need one small help. In my grid there is month slicer. If in the month slicer march month is selected then the grid must display values from jan to march. as of now it displays only the march value. I must get the values in the higlighted part. Your help would

be highly appreciated.

Capture2.PNG

DAX:

value_acvsbuDummy3 =
var period = SELECTEDVALUE('3a CWC - CWC as % of R12M Revenue'[Period])
var monthz = CALCULATE(MAX('3a CWC - CWC as % of R12M Revenue'[Month1]), MONTH('3a CWC - CWC as % of R12M Revenue'[Period])=period)
return
IF(monthz<period,CALCULATE(SUM(LE[AC])))
2 ACCEPTED SOLUTIONS

Hi @Anonymous ,

 

We can use the following steps to meet your requirement.

  1. Create a calendar table,
3a CWC - CWC as % of R12M Revenue =
GROUPBY (
    ADDCOLUMNS (
        CALENDARAUTO (),
        "Month", FORMAT ( [Date], "MMM" ),
        "MonthNumber", MONTH ( [Date] )
    ),
    [Month],
    [MonthNumber]
)

 

7.jpg

 

  1. Then we can create a measure, when keep no relationship between two tables, only this measure will be affected by the slicer.
Measure =
VAR date_ =
    MIN ( '3a CWC - CWC as % of R12M Revenue'[Month number] )
RETURN
    CALCULATE ( SUM ( 'LE'[AC] ), FILTER ( 'LE', 'LE'[Month number] <= date_ ) )

 

And we can get the result like this,

 

8.jpg

 

BTW, pbix as attached.


Best regards,

Community Support Team _ Dong Li
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

Hi @Anonymous ,

 

Glad to help you~

 

Could you please accept my answer or @v-lid-msft 's answer as a solution?

 

So other people will know that the problem is solved.

 

Thanks.

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
AiolosZhao
Memorable Member
Memorable Member

Hi @Anonymous ,

 

I have a workaround hope you can like it,

 

1. Create an index for your month column from 1.

2. Then you will get 1-12 for your month column, and put the index as the filter.

3. Then choose the Less than or equal to in the filter type like the below image

 

Values till the selected month.PNG

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Yes it is working but it is affecting all the rows. Still i will give it try with my team members. If they accept ill accept this as solution. Thanks mate

Hi @Anonymous ,

 

Glad to help you~

 

Could you please accept my answer or @v-lid-msft 's answer as a solution?

 

So other people will know that the problem is solved.

 

Thanks.

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi @Anonymous ,

 

We can use the following steps to meet your requirement.

  1. Create a calendar table,
3a CWC - CWC as % of R12M Revenue =
GROUPBY (
    ADDCOLUMNS (
        CALENDARAUTO (),
        "Month", FORMAT ( [Date], "MMM" ),
        "MonthNumber", MONTH ( [Date] )
    ),
    [Month],
    [MonthNumber]
)

 

7.jpg

 

  1. Then we can create a measure, when keep no relationship between two tables, only this measure will be affected by the slicer.
Measure =
VAR date_ =
    MIN ( '3a CWC - CWC as % of R12M Revenue'[Month number] )
RETURN
    CALCULATE ( SUM ( 'LE'[AC] ), FILTER ( 'LE', 'LE'[Month number] <= date_ ) )

 

And we can get the result like this,

 

8.jpg

 

BTW, pbix as attached.


Best regards,

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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