web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate and Pow...
Power Automate
Answered

Power Automate and Power BI DAX - how to formate?

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I have DAX query created by Power BI, and I have flow which creates html tabel to my email. This works fine but I would like to format the results a bit. How can I format date and headers? Now dates are in format 2024-04-29T05:44:08 and headers "IsGrandTotalRowTotal". I would like date to be dd/mm/yyyy and header for example "Grand Total"?

 

--DEFINE

VAR __DS0FilterTable =

FILTER(

KEEPFILTERS(VALUES('Dates'[Date])),

'Dates'[Date] >= (DATE(2022, 12, 31) + TIME(0, 0, 1))

)

 

VAR __DS0FilterTable2 =

TREATAS({3}, 'Item Ledger Entry '[Entry Type])

 

VAR __DS0FilterTable3 =

TREATAS({"Today"}, 'Dates'[Slicer Date])

 

VAR __DS0FilterTable4 =

TREATAS({"PPP"}, 'Purch Rec Lines'[Location Code])

 

VAR __DS0Core =

SUMMARIZECOLUMNS(

ROLLUPADDISSUBTOTAL(

ROLLUPGROUP('Dates'[Date], 'Items'[No], 'Items'[Description]), "IsGrandTotalRowTotal"

),

__DS0FilterTable,

__DS0FilterTable2,

__DS0FilterTable3,

__DS0FilterTable4,

"SumQuantity", CALCULATE(SUM('Purch Rec Lines'[Quantity])),

"Item_Ledger_Entry_Quantity", CALCULATE(SUM('Item Ledger Entry '[Quantity])),

"Quantity_plus_Quantity2", 'Dates'[Quantity plus Quantity2],

"New_Item", 'Dates'[New Item]

)

 

VAR __DS0PrimaryWindowed =

TOPN(

502,

__DS0Core,

[IsGrandTotalRowTotal],

0,

'Dates'[Date],

1,

'Items'[No],

1,

'Items'[Description],

1

)

 

EVALUATE

__DS0PrimaryWindowed

 

ORDER BY

[IsGrandTotalRowTotal] DESC, 'Dates'[Date], 'Items'[No], 'Items'[Description]--


BR

Matt

Categories:
I have the same question (0)
  • lbendlin Profile Picture
    8,598 Super User 2026 Season 1 on at

    When you borrow DAX code from a Power BI visual you want to first change the visual to Table and then disable the totals. That will result in much simpler DAX.

     

    Then you can use a "Select" action on "First Table Rows"  to remap the results.

  • Matt78 Profile Picture
    on at

    Hello

     

    Thank you for the quick reply. Which actions I need here and in which order?

     

    Run a query against a dataset

    Select

    Create HTML table

     

    When I use Select how can I remap the results, it requires key and value?

     

     

    br

    Matt

  • Verified answer
    lbendlin Profile Picture
    8,598 Super User 2026 Season 1 on at

    That is the right order of the steps. Key is your desired column name, Value is the content of the original column as it comes from the DAX query.  The Select action automatically enumerates the incoming array.

     

    Try without the Select first,  create the HTML table directly from the First Table Rows.  Then you will see the difference.

  • Matt78 Profile Picture
    on at

    Thank you. I got it 🙂

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard