The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Solved! Go to Solution.
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.
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.
Hi @v-lionel-msft
the below expression is not performing similar to TOTAL(COUNTD(InstanceID)
SUMX(ALL(Table),DISTINCTCOUNT(InstanceID)