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

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

Reply
jjaccesscu
New Member

How to export distinct values from a measure in a table to a csv

I have a table a that has several measures that are being displayed

example

 

memberrate [measure]amounttargetAcctcalcSum [measure]totalpermember [measure]ExportCol
a1.12%250.0240.12725,0.1272
a1.12%350.0360.12725,0.1272
a1.12%65

0.0672

0.12725,0.1272
b1.12%730.0840.1683,0.168
b1.12%730.0840.1683,0.168
c1.12%820.0960.0962,0.096

 

what I need to be able to export the distinct values of the Column [exportCol] into  a CSV 

 

the ExportCol is a measure and it needs the other columns in the table to calculate its values

is there a way to do this?

 

in the above example I want a file with the values

5,0.1272

3,0.168

2,0.096

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thank you lbendlin 

Hi, @jjaccesscu 

As the super user said, you need to implement the metric first. You can do it as follows:

First, I have the following dataset:

vjianpengmsft_0-1728875083852.png

vjianpengmsft_1-1728875113368.png

I created the following DAX expression:

EVALUATE
VAR _table = SUMMARIZE('Table','Table'[Column1],'Table'[Column2],'Table'[id],"measure",[Measure])
RETURN DISTINCT(SELECTCOLUMNS(_table,[measure]))

Use it in a DAX query view:

vjianpengmsft_2-1728875330046.png

Copy it and paste it into your Excel:

vjianpengmsft_3-1728875399149.png

In addition, you can also use DAX studio, where the above expression is also available. This tool supports direct export to a file:

vjianpengmsft_4-1728875797961.png

vjianpengmsft_5-1728875809805.png

vjianpengmsft_6-1728875866380.png

vjianpengmsft_7-1728875893297.png

 

 

Best Regards

Jianpeng Li

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

4 REPLIES 4
Anonymous
Not applicable

Thank you lbendlin 

Hi, @jjaccesscu 

As the super user said, you need to implement the metric first. You can do it as follows:

First, I have the following dataset:

vjianpengmsft_0-1728875083852.png

vjianpengmsft_1-1728875113368.png

I created the following DAX expression:

EVALUATE
VAR _table = SUMMARIZE('Table','Table'[Column1],'Table'[Column2],'Table'[id],"measure",[Measure])
RETURN DISTINCT(SELECTCOLUMNS(_table,[measure]))

Use it in a DAX query view:

vjianpengmsft_2-1728875330046.png

Copy it and paste it into your Excel:

vjianpengmsft_3-1728875399149.png

In addition, you can also use DAX studio, where the above expression is also available. This tool supports direct export to a file:

vjianpengmsft_4-1728875797961.png

vjianpengmsft_5-1728875809805.png

vjianpengmsft_6-1728875866380.png

vjianpengmsft_7-1728875893297.png

 

 

Best Regards

Jianpeng Li

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

 

 

 

 

 

lbendlin
Super User
Super User

You need to export all the columns that make the measure unique, then throw them away, and remove duplicates.  That means you need something to process your CSV accordingly.

Alternatively, create a separate visual that materializes the measures and produces the unique values as a column.

so I have to process the CSV after it is created and I can't  do that within Powerbi/dax as it is being exported?

 

correct.

 

Alternatively, create a separate visual that materializes the measures and produces the unique values as a column.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.