<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic DECIMAL in Quick Measures Gallery</title>
    <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DECIMAL/m-p/1062752#M471</link>
    <description>&lt;P&gt;&lt;A title="" href="https://community.powerbi.com/t5/Community-Blog/Excel-to-DAX-Translation/ba-p/1060991" target="_self"&gt;In my recent quest to create or catalog as many DAX equivalents for Excel functions&lt;/A&gt;&lt;SPAN&gt;, was able to use &lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/BASE/td-p/1062171" target="_self"&gt;BASE&lt;/A&gt; and &lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/BIN2DEC-Binary-to-Decimal/td-p/1061621" target="_self"&gt;BIN2DEC&lt;/A&gt; as references in order to create DECIMAL:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DECIMAL = 
    VAR __Text = MAX('Table'[Text])
    VAR __Radix = MAX('Table'[Radix])
    VAR __Dec2Base = 
        { 
            (0, "0"),
            (1, "1"),
            (2, "2"),
            (3, "3"),
            (4, "4"),
            (5, "5"),
            (6, "6"),
            (7, "7"),
            (8, "8"),
            (9, "9"),
            (10, "A"), 
            (11, "B"), 
            (12, "C"), 
            (13, "D"), 
            (14, "E"), 
            (15, "F"), 
            (16, "G"), 
            (17, "H"), 
            (18, "I"), 
            (19, "J"), 
            (20, "K"), 
            (21, "L"), 
            (22, "M"), 
            (23, "N"), 
            (24, "O"), 
            (25, "P"), 
            (26, "Q"), 
            (27, "R"),
            (28, "S"),
            (29, "T"),
            (30, "U"),
            (31, "V"),
            (32, "W"),
            (33, "X"),
            (34, "Y"),
            (35, "Z")
        }    
    VAR __Table = 
        ADDCOLUMNS(
            ADDCOLUMNS(
                ADDCOLUMNS(
                    GENERATESERIES(0,LEN(__Text)-1,1),
                    "Text",MID(__Text,LEN(__Text) - [Value],1)
                ),
                "Text2Decimal",MAXX(FILTER(__Dec2Base,[Value2] = [Text]),[Value1])
            ),
            "Decimal",POWER(__Radix,[Value]) * [Text2Decimal]
        )
RETURN
    SUMX(__Table,[Decimal])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN class="reportid hidden"&gt;eyJrIjoiYmZkZjRjN2YtMjVhMC00MzA3LWIzYjctNThkOTg2ZTEyOWMxIiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 02 May 2020 17:53:13 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2020-05-02T17:53:13Z</dc:date>
    <item>
      <title>DECIMAL</title>
      <link>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DECIMAL/m-p/1062752#M471</link>
      <description>&lt;P&gt;&lt;A title="" href="https://community.powerbi.com/t5/Community-Blog/Excel-to-DAX-Translation/ba-p/1060991" target="_self"&gt;In my recent quest to create or catalog as many DAX equivalents for Excel functions&lt;/A&gt;&lt;SPAN&gt;, was able to use &lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/BASE/td-p/1062171" target="_self"&gt;BASE&lt;/A&gt; and &lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/BIN2DEC-Binary-to-Decimal/td-p/1061621" target="_self"&gt;BIN2DEC&lt;/A&gt; as references in order to create DECIMAL:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DECIMAL = 
    VAR __Text = MAX('Table'[Text])
    VAR __Radix = MAX('Table'[Radix])
    VAR __Dec2Base = 
        { 
            (0, "0"),
            (1, "1"),
            (2, "2"),
            (3, "3"),
            (4, "4"),
            (5, "5"),
            (6, "6"),
            (7, "7"),
            (8, "8"),
            (9, "9"),
            (10, "A"), 
            (11, "B"), 
            (12, "C"), 
            (13, "D"), 
            (14, "E"), 
            (15, "F"), 
            (16, "G"), 
            (17, "H"), 
            (18, "I"), 
            (19, "J"), 
            (20, "K"), 
            (21, "L"), 
            (22, "M"), 
            (23, "N"), 
            (24, "O"), 
            (25, "P"), 
            (26, "Q"), 
            (27, "R"),
            (28, "S"),
            (29, "T"),
            (30, "U"),
            (31, "V"),
            (32, "W"),
            (33, "X"),
            (34, "Y"),
            (35, "Z")
        }    
    VAR __Table = 
        ADDCOLUMNS(
            ADDCOLUMNS(
                ADDCOLUMNS(
                    GENERATESERIES(0,LEN(__Text)-1,1),
                    "Text",MID(__Text,LEN(__Text) - [Value],1)
                ),
                "Text2Decimal",MAXX(FILTER(__Dec2Base,[Value2] = [Text]),[Value1])
            ),
            "Decimal",POWER(__Radix,[Value]) * [Text2Decimal]
        )
RETURN
    SUMX(__Table,[Decimal])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN class="reportid hidden"&gt;eyJrIjoiYmZkZjRjN2YtMjVhMC00MzA3LWIzYjctNThkOTg2ZTEyOWMxIiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 May 2020 17:53:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Quick-Measures-Gallery/DECIMAL/m-p/1062752#M471</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-05-02T17:53:13Z</dc:date>
    </item>
  </channel>
</rss>

