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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Jsonify
Frequent Visitor

Convert Tableau's functions into Power BI's measures [TOTAL(), WINDOW_MAX(), WINDOW_MIN()]

I am trying to convert a report over from Tableau the following Tableau functions in Power BI measures:

 

Given that TestInstance_ID is a column with a data type of Whole Number:

TOTAL(COUNTD ([TestInstance_ID]))

 

I know that the COUNTD ([TestInstance_ID]) equivalent is DISTINCTCOUNT([TestInstance_ID]), but I'm not sure about how to use the TOTAL() function out side of it the same way in Power BI.

 

Also, given that TestCycle_End_Date and TestCycle_Start_Date are columns with data types of Date:

WINDOW_MAX(MAX([TestCycle_End_Date]))-WINDOW_MIN(MIN([TestCycle_Start_Date]))

 

I have no idea where to begin with either of the WINDOW_MAX or WINDOW_MIN functions in the above situation. 

 

Any help here would be most appreciated.

 

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

Hi @Jsonify ,

 

Please try this.

//TOTAL(COUNTD ([TestInstance_ID]))
Measure = 
SUMX( ALL(table), DISTINCTCOUNT([TestInstance_ID]) )
//WINDOW_MAX(MAX([TestCycle_End_Date]))-WINDOW_MIN(MIN([TestCycle_Start_Date]))
MAXX( ALL(table), [TestCycle_End_Date] ) - MINXX( ALL(table), [TestCycle_Start_Date] )

If it's not useful, please provide sample data and expected output.

 

Best regards,
Lionel 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

3 REPLIES 3
v-lionel-msft
Community Support
Community Support

Hi @Jsonify ,

 

Please try this.

//TOTAL(COUNTD ([TestInstance_ID]))
Measure = 
SUMX( ALL(table), DISTINCTCOUNT([TestInstance_ID]) )
//WINDOW_MAX(MAX([TestCycle_End_Date]))-WINDOW_MIN(MIN([TestCycle_Start_Date]))
MAXX( ALL(table), [TestCycle_End_Date] ) - MINXX( ALL(table), [TestCycle_Start_Date] )

If it's not useful, please provide sample data and expected output.

 

Best regards,
Lionel Chen

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

Anonymous
Not applicable

Hi @v-lionel-msft 
the below expression is not performing similar to TOTAL(COUNTD(InstanceID) 
SUMX(ALL(Table),DISTINCTCOUNT(InstanceID)

 

 

amitchandak
Super User
Super User

@Jsonify ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors