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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
KellyM82
New Member

Add formating to ISFILTERED VAR measure

Hi there,

 

I have a DAX measure that returns the items selected from a slicer so that I can have the selected items listed within a table and the slicer panel hidden so it takes up less space on the canvas. It works for all slicers but it's currently returning the date format as MM/DD/YYYY and I need it to show as DD/MM/YYYY. The field is set to the correct format so I'm assuming I need to add the format into my DAX but I've tried a whole host of combinations and none are working. The DAX is as follows:

=
    -- Date
    IF(
        ISFILTERED('Data Table: Population'[Date]),
        VAR items = VALUES('Data Table: Population'[Date])
        VAR itemscombined = CONCATENATEX(items, 'Data Table: Population'[Date], UNICHAR(10))
        RETURN Itemscombined & UNICHAR(10)

Any help would be appreciated.
1 ACCEPTED SOLUTION
123abc
Community Champion
Community Champion

To format the date in your DAX measure, you can use the FORMAT function. In your existing DAX measure, you can add FORMAT to change the date format from MM/DD/YYYY to DD/MM/YYYY. Here's the modified DAX:

 

=
-- Date
IF(
ISFILTERED('Data Table: Population'[Date]),
VAR items = VALUES('Data Table: Population'[Date])
VAR itemscombined = CONCATENATEX(items, FORMAT('Data Table: Population'[Date], "DD/MM/YYYY"), UNICHAR(10))
RETURN itemscombined & UNICHAR(10)
)

 

In this modified DAX, the FORMAT function is used to format the date from 'Data Table: Population'[Date] as "DD/MM/YYYY". This will ensure that the date is displayed in the desired format in your table.

Make sure to adjust the format string within the FORMAT function according to your specific requirements, such as "DD/MM/YYYY" or "DD-MM-YYYY", depending on how you want the date to be displayed.

 

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

 

In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.

View solution in original post

3 REPLIES 3
123abc
Community Champion
Community Champion

To format the date in your DAX measure, you can use the FORMAT function. In your existing DAX measure, you can add FORMAT to change the date format from MM/DD/YYYY to DD/MM/YYYY. Here's the modified DAX:

 

=
-- Date
IF(
ISFILTERED('Data Table: Population'[Date]),
VAR items = VALUES('Data Table: Population'[Date])
VAR itemscombined = CONCATENATEX(items, FORMAT('Data Table: Population'[Date], "DD/MM/YYYY"), UNICHAR(10))
RETURN itemscombined & UNICHAR(10)
)

 

In this modified DAX, the FORMAT function is used to format the date from 'Data Table: Population'[Date] as "DD/MM/YYYY". This will ensure that the date is displayed in the desired format in your table.

Make sure to adjust the format string within the FORMAT function according to your specific requirements, such as "DD/MM/YYYY" or "DD-MM-YYYY", depending on how you want the date to be displayed.

 

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

 

In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.

That's perfect, thank you so much 😊

123abc
Community Champion
Community Champion

You are always wellcome.😊

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 FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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