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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
DmitryD77
Frequent Visitor

Recreate an Excel table in Power BI

Hello community.

 

Please help me recreate the Excel table in Power BI.

Expected result:

Result.png

Link to sample file.

 

Thanks in advance.

1 ACCEPTED SOLUTION
aduguid
Super User
Super User

First I would create a calculated column in "fct_test_results".

 

Rank = 
RANKX(
    FILTER(
        fct_test_results,
        fct_test_results[Course] = EARLIER(fct_test_results[Course])
    )
    , fct_test_results[Pace],
    , ASC
)

 

Then you can create a DAX query for the results.

 

fct_test_results_pivot = 

VAR _result = 
UNION(
	SELECTCOLUMNS(fct_test_results
	, "Course"		    , fct_test_results[Course]
    , "Rank"		    , fct_test_results[Rank]
	, "Column Value"	, fct_test_results[Pace]
	, "Column Name"	    , "Pace")
,
	SELECTCOLUMNS(fct_test_results
	, "Course"		    , fct_test_results[Course]
    , "Rank"		    , fct_test_results[Rank]
	, "Column Value"	, FORMAT(fct_test_results[Pace Test Result], "0%")
	, "Column Name"	    , "Result")
, 
	SELECTCOLUMNS(fct_test_results
	, "Course"		    , fct_test_results[Course]
    , "Rank"		    , fct_test_results[Rank]
	, "Column Value"	, FORMAT(fct_test_results[Pace Test Date], "MM/dd/yyyy")
	, "Column Name"	    , "Date")
)

RETURN
_result

 

If you want a different sort, you can create an additional DAX query and then relate it to the pivot.

 

Metric List = 
VAR _results = 
DATATABLE (
      "Column Name",   STRING
	, "Column Order",  INTEGER
	,
    {
          {"Pace",      1}
		, {"Result",    2}
		, {"Date",	    3}
    }
)

RETURN
_results

 

aduguid_0-1716425716456.png

In this matrix I've used the [Course] from the "fct_test_results_pivot", [Column Name] from "Metric List" (which has a column sort on [Column Order]), [Rank] from "fct_test_results_pivot" and the first [Column Value] from "fct_test_results_pivot". If you have a unique key/id, you can include it in the pivot and relate it back to your original table so date filters would still work.

aduguid_3-1716426312851.png

View solution in original post

3 REPLIES 3
DmitryD77
Frequent Visitor

@aduguid thank you!

no worries, anytime, happy to help

aduguid
Super User
Super User

First I would create a calculated column in "fct_test_results".

 

Rank = 
RANKX(
    FILTER(
        fct_test_results,
        fct_test_results[Course] = EARLIER(fct_test_results[Course])
    )
    , fct_test_results[Pace],
    , ASC
)

 

Then you can create a DAX query for the results.

 

fct_test_results_pivot = 

VAR _result = 
UNION(
	SELECTCOLUMNS(fct_test_results
	, "Course"		    , fct_test_results[Course]
    , "Rank"		    , fct_test_results[Rank]
	, "Column Value"	, fct_test_results[Pace]
	, "Column Name"	    , "Pace")
,
	SELECTCOLUMNS(fct_test_results
	, "Course"		    , fct_test_results[Course]
    , "Rank"		    , fct_test_results[Rank]
	, "Column Value"	, FORMAT(fct_test_results[Pace Test Result], "0%")
	, "Column Name"	    , "Result")
, 
	SELECTCOLUMNS(fct_test_results
	, "Course"		    , fct_test_results[Course]
    , "Rank"		    , fct_test_results[Rank]
	, "Column Value"	, FORMAT(fct_test_results[Pace Test Date], "MM/dd/yyyy")
	, "Column Name"	    , "Date")
)

RETURN
_result

 

If you want a different sort, you can create an additional DAX query and then relate it to the pivot.

 

Metric List = 
VAR _results = 
DATATABLE (
      "Column Name",   STRING
	, "Column Order",  INTEGER
	,
    {
          {"Pace",      1}
		, {"Result",    2}
		, {"Date",	    3}
    }
)

RETURN
_results

 

aduguid_0-1716425716456.png

In this matrix I've used the [Course] from the "fct_test_results_pivot", [Column Name] from "Metric List" (which has a column sort on [Column Order]), [Rank] from "fct_test_results_pivot" and the first [Column Value] from "fct_test_results_pivot". If you have a unique key/id, you can include it in the pivot and relate it back to your original table so date filters would still work.

aduguid_3-1716426312851.png

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.