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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
D4life
Regular Visitor

Parameter fields display only data for the current month by default

I created a table with parameter fields. There are about 30 different columns in the parameter filed. I want the table to only should records for only the current month. Then when the date slicer is used it should show based on the date slicer. If the report is loaded again, it should show only records for the current month.

I thought I could filter the date column withing the Parameter field using dax but this is not working.

 

Can anyone help?

1 ACCEPTED SOLUTION
v-nuoc-msft
Community Support
Community Support

Hi @D4life 

 

I understand your needs, please try the following ways:

“Table”

 

vnuocmsft_0-1723514475524.png

 

Delete the relationship between two tables.

 

vnuocmsft_1-1723514489622.png

 

Create a measure. If the date matches the selection in the slicer, it is marked as 1, otherwise 0. If slicer is not selected, mark the day date as 1.

 

Measure Parameter = 
VAR _SelectDate = VALUES('Date'[Date])
RETURN
IF(
    ISFILTERED('Date'[Date])
    && 
    SELECTEDVALUE('Table'[Date]) in _SelectDate,
    1,
    IF(
        NOT(ISFILTERED('Date'[Date]))
        &&
        SELECTEDVALUE('Table'[Date]) = TODAY(),
        1,
        0
    )
)

 

Apply this measure to the filters pane.

 

vnuocmsft_4-1723514933031.png

 

 

Create a table visual.

 

vnuocmsft_3-1723514867060.png

 

Here is the result.

 

vnuocmsft_5-1723514974086.png

 

vnuocmsft_6-1723514988812.png

 

Regards,

Nono 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

5 REPLIES 5
v-nuoc-msft
Community Support
Community Support

Hi @D4life 

 

I understand your needs, please try the following ways:

“Table”

 

vnuocmsft_0-1723514475524.png

 

Delete the relationship between two tables.

 

vnuocmsft_1-1723514489622.png

 

Create a measure. If the date matches the selection in the slicer, it is marked as 1, otherwise 0. If slicer is not selected, mark the day date as 1.

 

Measure Parameter = 
VAR _SelectDate = VALUES('Date'[Date])
RETURN
IF(
    ISFILTERED('Date'[Date])
    && 
    SELECTEDVALUE('Table'[Date]) in _SelectDate,
    1,
    IF(
        NOT(ISFILTERED('Date'[Date]))
        &&
        SELECTEDVALUE('Table'[Date]) = TODAY(),
        1,
        0
    )
)

 

Apply this measure to the filters pane.

 

vnuocmsft_4-1723514933031.png

 

 

Create a table visual.

 

vnuocmsft_3-1723514867060.png

 

Here is the result.

 

vnuocmsft_5-1723514974086.png

 

vnuocmsft_6-1723514988812.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

 

 

 

 

v-nuoc-msft
Community Support
Community Support

Hi @D4life 

 

Thank you very much lbendlin for your prompt reply, please allow me to share some content here.

 

Here's some dummy data

 

"Table"

vnuocmsft_0-1723194693201.png

 

Create a New Date Table. And create a relationship based on date columns.

 

Date = CALENDAR("7/1/2024", TODAY())

 

vnuocmsft_1-1723194802013.png

 

Create a measure. Determines whether to select a date for filtering. By default, the parameter field only shows data for the current month.

 

Measure Parameter = 
IF(
    ISFILTERED('Date'[Date]),
    CALCULATE(
        SELECTEDVALUE('Table'[Parameter]),
         FILTER(
            ALL('Table'),
            'Table'[Date] = SELECTEDVALUE('Date'[Date])
         )
    ),
    IF(
        SELECTEDVALUE('Table'[Date]) = TODAY(),
        SELECTEDVALUE('Table'[Parameter])
    )
)

 

Here is the result.

 

vnuocmsft_2-1723194948056.png

 

vnuocmsft_3-1723194970465.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you for your response. In my case the date column has repeated dates. Just like a normal transaction data would have. I noticed your solution had both columns unique. In my case both are not Unique. At least the date column is not unique.
Please assist with any suggestion

D4life
Regular Visitor

Thank you for your response.

I created a new column and used dax to check if the "Effective Date" column is a date in the current month, and it will give "Letest" otherwise "Old".
Step 2 - You said I should sort the new column by the original Date column. This gives the following error
" We can't sort "IsCurrentMonth" column by "Effective Date " . There can't be more than one value in "Effective Date " for the same value in "IsCurrentMonth". Please choose a different column for sorting. "

Please assist

lbendlin
Super User
Super User

Here's a general approach for that:
- create a string representation of your date column, replace the latest date with a string "Latest"
- sort that new column by the original date column
- add a slicer or visual/page/report level filter
- set the filter to "Latest"
- publish the pbix to the workspace/app

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.