Skip to main content

Notifications

Community site session details

Community site session details

Session Id : o3behoplJ7DulGabgbjUZJ
Power Automate - Building Flows
Unanswered

Power BI run a query against a dataset; struggling with DAX query

Like (0) ShareShare
ReportReport
Posted on 7 Mar 2023 14:20:16 by 2

Hi all,

 

Realise this is probably bordering on a Power BI forum query, so please say so if this is the case! Here's my issue;

 

I have a fairly detailed dashboard in Power BI; this draws on local data, but is published weekly to the online service. I am trying to create a PA flow that can gather summaries of this data also on a weekly basis to populate a sharepoint list.

 

The data takes the form of a single dataset (that I'm interested in anyway) and I'm trying to summarise by two different columns - example below:

 

ProjectStatusID
Watford StreetPending1
PiccadillyClosed2
Gregg RoadClosed3
Watford StreetClosed4
Watford StreetIn progress5
Gregg RoadIn progress6
PicccadillyPending7
Watford StreetPending8
Gregg RoadPending9

 

Essentially I'm trying get a single summarised value (as a count) out of this sort of data to generate an output per DAX query

DAX query one: 'Watford Street and Pending': '2'

DAX query two: 'Watford Street and In progress': '1'

 

etc..

 

Null results can be resolved easily using an expression and I can easily enough use an expression to "chop up" the output of the DAX query just down to the number itself (although obviously, if there was a way for the output to be literally just the number that would be ideal).

 

I've done quite a lot of Googling on this and tried many solutions, some of which seem to work but only temporarily and when the data updates (and this is confirmed to be present in PBI online by using a simple matrix on the PBI dashboard) it doesn't pull it through.

 

This is the query I'm using at the moment, but as said, it doesn't really work. The data table is called 'Snags'.

 

// DAX Query
DEFINE
VAR __DS0FilterTable =
TREATAS({"Pending"}, 'Snags'[Status])
VAR __DS0FilterTable2 =
FILTER(
KEEPFILTERS(VALUES('Snags'[Project])),
'Snags'[Project] IN {"[Watford Street]"} )
EVALUATE
SUMMARIZECOLUMNS(
__DS0FilterTable,
__DS0FilterTable2,
"CountProject", IGNORE(CALCULATE(COUNTA('Snags'[Project])))
)

 

Any help would be appreciated (and to be honest, if there's a way of simplifying the DAX query for the Power BI "Run a query against a dataset" action then I'm all for it!

 

Cheers

 

BG

  • Babaganoush Profile Picture
    2 on 07 Mar 2023 at 15:26:39
    Re: Power BI run a query against a dataset; struggling with DAX query

    Edit: I've now discovered (quite painfully) what the cause of the non-updating was; we use a common account for PBI but we've had sign-in issues recently and it had reverted to the personal credentials, so the PBI dashboard had published to a different account, hence the query was running on old data! Lesson learnt.

     

    That said, if anyone does have any insight on how to make the query cleaner I'd certainly be all ears!

     

    Cheers

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 14 Super User 2025 Season 1

#1
stampcoin Profile Picture

stampcoin 14

#3
Churchy Profile Picture

Churchy 12

Overall leaderboard
Loading started